Angular Kendo dropdown

532 views Asked by At

I am using angular kendo dropdownlist using below code. Here the k-data-value-field is an object. I am able to populate the list in the dropdown. My issues is if I have only element in the list then that's not automatically selected in the dropdown. It works for me if the k-data-value-field is simply an Id (int or string). The issue is while the k-data-value-field is an object.

Html code -

  <select id ='ddlselectedH2OAnalyzer' kendo-drop-down-list 

                                            k-ng-model="selectedH2OAnalyzer" 
                                            k-ng-disabled="!receiptPointSelected && !(isAllAnalyzersChecked && businessUnitSelected)"                                            
                                            k-data-text-field="'Displayname'"
                                            k-data-value-field="'analyzers'"
                                            k-data-source="analyzersItems"
                                            k-value-primitive="true"
                                            style="width: 100%"></select>
1

There are 1 answers

1
Nonik On

Correct me if I am wrong, my understanding you have a list of objects with nested properties?

If that is the case you need to bind like this k-data-value-field="'analyzer.YourPropertyName'"

Otherwise you cannot bind to an object. Ilona Kheyfets