Programatically clearing all the filters in a grid

1 Answer 3708 Views
General Discussions
Simon
Top achievements
Rank 1
Simon asked on 25 Jan 2018, 06:35 PM
I'm using a very simple filtered grid (e.g. similar to your filter row example https://www.telerik.com/kendo-angular-ui/components/grid/data-operations/filtering/#toc-filter-row) and I'd like to write 'clear all filters' button. I'm sure this is easy, but I'm struggling to figure out how to do this?
Chau
Top achievements
Rank 1
commented on 26 Jan 2018, 03:16 PM

Look at this link: https://plnkr.co/edit/QBD676skKw2YDmhmueWF?p=preview

That should help.

1 Answer, 1 is accepted

Sort by
0
Dimiter Topalov
Telerik team
answered on 26 Jan 2018, 03:16 PM
Hello Simon,

You can achieve the desired functionality by resetting the CompositeFilterDescriptor object the Grid component's filter option is bound to and processing the data in accordance with the new (empty) filters.

Here is a sample implementation of the described approach, based on the mentioned online demo:

https://plnkr.co/edit/L8XfMJHRteopxLRkEDhz?p=preview

I hope this helps.

Regards,
Dimiter Topalov
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
General Discussions
Asked by
Simon
Top achievements
Rank 1
Answers by
Dimiter Topalov
Telerik team
Share this question
or