Question

I have a kendo grid with server side paging. On the same page, I also have a clear button which should clear the data of the grid and replace it with blank rows. Is it possible to clear the filters of that grid, without calling the server side read? Currently when I do this, $("#grid").data("kendoGrid").dataSource.filter({}), it will call the server side function and load the data. Anyone can point me to the right direction? Thanks.

Était-ce utile?

La solution

Despite serverFiltering set to false by default, it seems that filter() automatically calls transport read every single time.

However, you can try this:

dataSource._filter = null;

This will cancel any filters applied to the dataSource without calling transport read. But, you have to be cautious with this approach as it isn't an "official" configuration documented by Telerik. The property _filter is internal, so to speak.

You can verify this works by console logging the requestEnd event and seeing that this doesn't make a request.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top