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

Reset filter after reloading the grid

1 Answer 1482 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Khushali
Top achievements
Rank 1
Khushali asked on 03 Apr 2012, 12:35 PM
Hi,

I have a kendo grid. And i am using filters on all the columns. Suppose i filtered on some column and did not clear it. Now, when i reload the grid, i want to clear the filter.I dont want to preserve the filtered stated. If i don't clear it, then the new data is getting rendered only when i clear the filter(as it doesn't have any row matching the filter search criteria). I am reloading the grid this way :

var grid = $("#" + gridDivId).data("kendoGrid");
        var new_data = gridData;
        grid.dataSource.data(new_data);
        grid.dataSource.page(1);

What should i add to achieve that?

Regards,
Khushali

1 Answer, 1 is accepted

Sort by
0
Iliana Dyankova
Telerik team
answered on 06 Apr 2012, 08:01 AM
Hello Khushali,

In order to clear the filters when you reload the Grid you could pass to the dataSource an empty object. For example: 
grid.dataSource.filter({});

This way the filters will be removed and all the data will be available again.

I hope this helps.


Kind regards,
Iliana Nikolova
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Grid
Asked by
Khushali
Top achievements
Rank 1
Answers by
Iliana Dyankova
Telerik team
Share this question
or