Datasource Read

0 Answers 69 Views
Grid
AP
Top achievements
Rank 1
Iron
Iron
Veteran
AP asked on 22 Dec 2022, 08:34 AM

I'm working on a new project using version v2022.3.1109. There seems to have been a change of behavior since the last version I used. When a call to a grids datasource read method fails, the grid isn't cleared of data, as used to be the case.

This can give a user the impression the call has worked. I can trap data source errors, but there doesn't seem to be a method to clear the current data from the grid.

What's the easiest way to clear the datasource if a read call fails?

The read call looks like:


 $("#Grid").data("kendoGrid").dataSource.read();

Thanks

Georgi
Telerik team
commented on 26 Dec 2022, 02:00 PM

Hi,

One way to set clear the dataSource is to pass an empty array to the data method:

grid.dataSource.data([])

No answers yet. Maybe you can help?

Tags
Grid
Asked by
AP
Top achievements
Rank 1
Iron
Iron
Veteran
Share this question
or