How to enable Quick Filter in AG Grid Community in 2024

43 Views Asked by At

The setQuickFilter function seems to be deprecated from looking at AG-Grid Community node modules. Not sure why the site does not explain an alternative for quick filtering as their explanations use this function which seems to be depricated.

In the deprication notes Node Modules it suggests "call rowNode.setSelected(value) instead." If anyone has done this can you please show an example of how to get this working?

I tried to use the setQuickFilter function from the gridApi but the function will not show up because it appears as deprecated. I am not sure how to import or set up the rowNode needed to to the setSelected call advised in the deprecation notes.

1

There are 1 best solutions below

1
nd10 On

Yes, we need to use the setGridOption method to achieve the quick filter functionality. Something like this:

applyQuickFilter(filterText: string) {   
    this.gridApi.setGridOption('quickFilterText', filterText); 
}