SelectedItems with primaryKey field only
See original GitHub issueWe usually store only ids/value field in the DB for dropdown items. While fetching the record, we have only list of selected ids/value i.e. [‘Singapore’, ‘India’] instead of array of objects.
It would be good to have this feature where developer don’t have to manipulate the data for to pre-populate the selectedItems
this.dropdownList = [
{ "id": 1, "name": "India" },
{ "id": 2, "name": "Singapore" },
{ "id": 3, "name": "Australia" },
{ "id": 4, "name": "Canada" },
{ "id": 5, "name": "South Korea" },
{ "id": 6, "name": "Brazil" }
];
// Should allow selected items to be only array of primarykey
// this.selectedItems = [ 'India', 'Singapore', 'Australia'];
this.selectedItems = [
{ "id": 1, "name": "India" },
{ "id": 2, "name": "Singapore" }];
this.settings = {
text: "Select Countries",
selectAllText: 'Select All',
unSelectAllText: 'UnSelect All',
primaryKey: 'name',
labelKey: 'name',
};
https://stackblitz.com/edit/angular2-multiselect-dropdown-bug-sbzntx
Issue Analytics
- State:
- Created 4 years ago
- Reactions:6
- Comments:8 (3 by maintainers)
Top Results From Across the Web
Retrieving Primary Key Field Values for Selected Items
You can use the DataKeyNames and DataKeyValues arrays of the GridTableView object for this purpose. When you specify a primary key field by...
Read more >Entity Framework generic method to retrieve primary key from ...
A better route is to define a base class that your entities all derive from that include those kinds of common fields.
Read more >Combo Box Selected Items - Lookup Field Issues
By default, the Dataverse lookup field itself will only have the primary column (such as Name), and the primary key (GUID), of the...
Read more >How can I retrieve the primary key of the selected item in a ...
I just added question marks around serviceProviderComboBox.SelectedItem and productComboBox.SelectedItem. I don't know what put here. Sorry, I ...
Read more >Combo box control in Power Apps | Search, Filter, Large Data ...
... default selected items, selected items, connecting to data source, ... multiple fields ✓ Combo box as people picker ✓ Power Apps Combo ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
+1
I’ll add that it’s not clear to me what the purpose of primaryKey is
Ah here I am 2 Years later, is this available ? Or is there a timeline ?