This is a migrated thread and some comments may be shown as answers.

Grid incorrectly displaying removed rows

1 Answer 333 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Danny
Top achievements
Rank 1
Danny asked on 05 Jun 2017, 09:13 PM

Hi,

There is an issue with the Kendo Grid when interacting with the grid after removing all items from the dataSource directly. The grid behaves as expected when there are items in the grid, but when the last row is removed and a sort or filter is applied, the original records all reappear in the grid.

Here is a jsfiddle that shows the issue happening: http://jsfiddle.net/wqw34qa0/3/

In the jsfiddle, if you remove all four rows and then sort a column, all four records are added back into the grid. We use this approach to removing items versus calling the removeRow method on the grid object directly because we have many situations in which we need to remove upwards of thousands of rows at a time and it is inefficient to remove them one at a time with the removeRow method. The pushDelete method on the dataSource, in my experience, is also very inefficient at deleting thousands of records at a time (although we are using 2015 R2, so I'm not sure if improvements have been made since then).

Is there a solution where we can continue to update the dataSource.data property and keep it in sync with the grid, even when all items are deleted? Or must we use another approach?

Thank you.

1 Answer, 1 is accepted

Sort by
0
Accepted
Stefan
Telerik team
answered on 07 Jun 2017, 11:23 AM
Hello Danny,

The demonstrated result is expected because when the Grid data is empty and operations like sort and filtering are made the Grid is requesting the data which in this case is the original data.

If the Grid is using a remote data source, and the changes are synced on the server the issue will not occur.

The other option will be to set the Grid with empty data, and then use the data method to set in data originally:

http://dojo.telerik.com/iXuBe

Regards,
Stefan
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
Grid
Asked by
Danny
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Share this question
or