Our blazing fast Grid component built with pure JavaScript


Post by notepads »

As you see the picture below, the x button, I can't find any function, event or properties. I want to do certain actions in the event when the user clicks 'X' button in the filterBar. How do I call this function ?

https://imgur.com/a/bSbRmtx


Post by alex.l »

Hi notepads,

FilterBar (https://bryntum.com/docs/grid/#Grid/feature/FilterBar) manages filters of the store in the grid. To clear that value you need to remove filter in the grid store.
As an example, you may use the next code:

const cityFilter = grid.store.filters.getBy('id', 'city');
grid.store.removeFilter(cityFilter);

// or if you want to clear all fields in FilterBar
grid.store.clearFilters();

All best,
Alex

All the best,
Alex


Post by notepads »

alex.l wrote: Tue Sep 08, 2020 11:15 am

Hi notepads,

FilterBar (https://bryntum.com/docs/grid/#Grid/feature/FilterBar) manages filters of the store in the grid. To clear that value you need to remove filter in the grid store.
As an example, you may use the next code:

const cityFilter = grid.store.filters.getBy('id', 'city');
grid.store.removeFilter(cityFilter);

// or if you want to clear all fields in FilterBar
grid.store.clearFilters();

All best,
Alex

Thank you for replying Alex. Can I please know any event when you click the 'X'button? That code you showed me is that I can delete the keyword manually, but i would like to go to the function when the user clicks 'X' button.


Post by saki »

The X button is clear trigger of the TextField that is used in the FilterBar. This field fires https://bryntum.com/docs/scheduler/#Core/widget/TextField#event-clear event so you can install a custom listener on it and do your handling therein.


Post by notepads »

saki wrote: Wed Sep 09, 2020 2:33 pm

The X button is clear trigger of the TextField that is used in the FilterBar. This field fires https://bryntum.com/docs/scheduler/#Core/widget/TextField#event-clear event so you can install a custom listener on it and do your handling therein.

Saki, thank you very much!


Post Reply