I have a simple grid and just want a button to clear all search filters. I can clear the actual filters, but the values in the textbox persist (screenshot below). How can I clear those textboxes?
1 Answer, 1 is accepted
0
Hetali
Telerik team
answered on 31 Aug 2021, 06:48 PM
Hi Fredric,
In order to clear the values from the Kendo UI Grid filter row, use the following custom function and use the click method:
public clearFilter() {
var clearButton = document.querySelectorAll<HTMLElement>('.k-clear-button-visible');
for (let i = 0; i < clearButton.length; i++) {
setTimeout(() =>clearButton[i].click());
}
}
In this StackBlitz example, along with clearing the filter, I could also clear the filter textboxes in the Kendo UI Grid.
I hope this helps. Please let me know if I can further assist you.