Kendo Grid Server Side filtering

1 Answer 630 Views
Filter Grid
GOVERTHANAN
Top achievements
Rank 1
Iron
GOVERTHANAN asked on 07 Apr 2022, 05:02 AM | edited on 07 Apr 2022, 05:05 AM
I have a kendo grid with server side paging and server side filtering. 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.

1 Answer, 1 is accepted

Sort by
0
Georgi Denchev
Telerik team
answered on 11 Apr 2022, 11:39 AM

Hello, Goverthanan,

You can prevent the requestStart event of the dataSource when you click on the clear button:

      $("#clear").on("click", function() {
        let grid = $("#grid").data("kendoGrid");
        grid.dataSource.one("requestStart", function(e) {
          e.preventDefault();
        });
        grid.dataSource.filter({});
      });

This will empty the filter object without making a request to the server, however you won't see the changes visually until you make a request.

Let me know if this works for you.

Best Regards,
Georgi Denchev
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
Filter Grid
Asked by
GOVERTHANAN
Top achievements
Rank 1
Iron
Answers by
Georgi Denchev
Telerik team
Share this question
or