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

Add event to clear filter on grid

1 Answer 331 Views
Grid
This is a migrated thread and some comments may be shown as answers.
John
Top achievements
Rank 2
John asked on 18 Apr 2013, 02:11 PM
I have a button at top that I wire up to do a filter reset.  I show that button whenever a filter is applied.  However in the columnMenu filter clear, it does clear the filtering of the data, but I need it to hide that button IF there are no more filters.  I am overriding the filter function with a custom filter

Questions:
1)  Is there a way to tie into the clear event that is fired from filterMenu to update certain UI elements?
2) Is there a way to identify if ANY filter is on a grid since the filter function loops through column by column and I want to know if ANY filter is applied?

Thanks.

-John-

1 Answer, 1 is accepted

Sort by
0
Dimiter Madjarov
Telerik team
answered on 19 Apr 2013, 10:21 AM
Hello John,


You could get the current filter information for the Grid via the filter method of the dataSource. When the Grid is initially loaded with no filters applied, it returns undefined. When a filter is applied at some point and then cleared it returns null. Both of the current issues could be handled if you bind to the dataBound event of the Grid and check the dataSource filter data.

 

Regards,
Dimiter Madjarov
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
John
Top achievements
Rank 2
Answers by
Dimiter Madjarov
Telerik team
Share this question
or