Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to turn off ag-grid quick filter for specific column

Tags:

filter

ag-grid

AG-grid has "quick filter" feature, essentially a free-text search filter that searches through all columns. The problem is, in some columns, I have date-time values and I don't want to search through data in those columns.

Using "column filter" to filter on each column separately is not an option because this will give me "AND" behavior: only when all columns that I search through contain the data I search for will this column be visible. And I need "OR" behavior: a row that contains the data I search for in any column (except column that has date-time values) should be visible.

So, how can I remove some columns from the set of columns this "quick filter" searches through?

like image 878
tseshevsky Avatar asked Aug 27 '18 14:08

tseshevsky


People also ask

How do you remove the filter on Ag grid column?

Enable filtering by setting grid property enableFilter=true. This turns on filtering on all columns. To turn off filtering for particular columns, set suppressFilter=true on the individual column definition.

How do I enable filter on Ag grid column?

Configuring Filters on Columns Set filtering on a column using the column definition property filter . The property can have one of the following values: boolean : Set to true to enable the default filter. The default is Text Filter for AG Grid Community and Set Filter for AG Grid Enterprise.

How do you clean the filter on Ag grid?

The Clear button clears just the filter UI, whereas the Reset button clears the filter UI and removes any active filters for that column. The Cancel button will discard any changes that have been made in the UI, restoring the state of the filter to match the applied model.


1 Answers

I just needed to set an "empty" function as "getQuickFilterText" function for the column I don't want to search through:

colDef = {
    getQuickFilterText: () => ''
}
like image 151
tseshevsky Avatar answered Oct 13 '22 08:10

tseshevsky