Adding a custom data item programmatically and selecting it is not supported with server filtering enabled and here is why.
When server filtering is enabled, the dropdown shows only items, which match the filtering criteria, i.e. what the user has typed. If a new value is set programmatically, the filtering criteria should be cleared:
ddl = angular.element(
$scope.myModel = 1
However, if the filter state is cleared and a new value is set programmatically, the DropDownList will try to reload its data the next time it is opened, so that it can display the new value in the context it exists (e.g. all other items, and not the previous subset of filtered items). This data reload will cause the custom data item and custom value to be lost.
There are two ways to proceed:
- do not use server filtering, so that the DropDownList does not make remote requests, which clear the custom data item and value
- add the custom data item server-side, instead of client-side, so that it can be loaded together with the other data items
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI