Reputation: 1778
I'm having problems with Kendo Grid, specifically with filtering and an empty auto complete. If I set datasSource.data when I initialize the grid, then autocomplete functionality works as expected. But I have to retrieve remote data asynchronously and then set the data in the grid once that resolves. The user can request new data which we then update the grid with. When I update dataSource.data(myNewData) and then try to filter, the autocomplete box shows 'Data Not Found'.
I've provided a working example here, search name for 'ja' and autocomplete shows 'Jane' https://dojo.telerik.com/aFewItOw
I've provided the broken example here, search for 'ja' and autocomplete shows 'Data Not Found'. https://dojo.telerik.com/AkEvAcUd
What is the key to getting autocomplete to work when data is set after grid initializes?
Upvotes: 0
Views: 322
Reputation: 4497
I am going to assume this is what you are after: https://dojo.telerik.com/AkEvAcUd/2
All I have done is reset the datasource's data object for you so that the grid's "auto binding" will take over
grid.data('kendoGrid').setOptions({
dataSource: {
data: [{
name: "Jane",
age: 30
}, {
name: "John",
age: 33
}]
}
});
setting the options will force the grid to rebind all the relevant items for you.
This usually isn't a problem if you are binding to a remote source.
Upvotes: 1