The Dropdowns, autocompletes and pretty much every component in the Kendo Angular 2 should allow the developer to specify a callback function in the [valueField] or the [textField] attributes so we can use complex objects with these components.
This way, we could do this:
//template
<kendo-autocomplete [data]="nodes"
[valueField]="getDataValue"
[placeholder]="'search'"
class="search">
</kendo-autocomplete>
//class
public getDataValue(node: any): string {
return node.getData().getName();
}
This functionality is available on almost every other component set out there, but is somehow missing from Kendo. It makes the components almost useless outside of running simple plunkr examples that work with contrived data objects with very little depth. In the real world, particularly with typescript, data object hierarchies are commonplace and this is simply a must have feature.
Hi Bill,
Thank you for the feedback.
The DropDowns are not designed to work with new data array instances on each change detection cycle. With larger data sets, this would lead to poor performance, especially on slower browsers and computers. Therefore, this is not supported.
If you need to change the data set on certain user interactions, hook to one of the component events and substitute the data only on such occasions.
Regards,
Martin
Progress Telerik