Consider the following scenario: There is a sortable Kendo-UI grid with a corresponding dataSource. Initially, the dataSource contains some items. When updating the dataSource to an empty array, all items disappear from the grid - so far, so good. However, if a column header is clicked afterwards to sort that column, the removed data reappears again.
We created a small "walkthrough" in this DOJO to demonstrate the issue.
FYI: The issue can be avoided by using a custom implementation of dataSource.transport.read which always returns the latest data.
Hi!
While your solution works, dataSource.transport is an undocumented field which is also missing in the Typescript type definitions This is a hacky workaround at best, but does not seem like the appropriate way of updating a dataSource's data.
Please reconsider.
Hello Michael,
To ensure the locally bound data source does not restore the original data, you can set the transport.data to an empty array:
// clear the data
dataSource.data([])
dataSource.transport.data = [];Regards,
Peter Milchev
Progress Telerik