Column filters are filters that are applied to the data at the column level. Many column filters can be active at once (e.g. filters set on different columns) and the grid will display rows that pass every column's filter.
Access via Tool Panel
Example: Simple Filters
The example below demonstrates simple filters. The following can be noted:
- Column Athlete has a simple text filter.
- Column Age has a simple number filter.
- Column Date has a simple date filter.
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
trueto enable the default filter. The default is Text Filter for ag-Grid Community and Set Filter for ag-Grid Enterprise.
Component: Provide a specific filter to use instead of the default filter.
The code below shows some column definitions with filters set:
If you want to enable filters on all columns, you should set a filter on the
Default Column Definition.
The following code snippet shows setting
filter=true for all columns via the
defaultColDef and then setting
filter=false for the Sport column, so all
columns have a filter except Sport.
Each filter can take additional filter parameters by setting
The parameters each filter type accepts are specific to each filter; parameters for the provided
filters are explained in their relevant sections.
The code below shows configuring the text filter on the Athlete column and providing extra filter parameters
buttons do is explained in
Apply, Clear, Reset and Cancel Buttons).
Filtering causes the following events to be emitted:
- Filter Changed: Filter has changed and been applied by the grid.
- Filter Modified: Filter UI has changed but not necessarily applied. This is useful when using an apply button if you want to know if the filter changed but was not applied.
To enable animation of the rows when filtering, set the grid property
Relation to Quick Filter and External Filter
Column filters work independently of Quick Filter and External Filter. If a quick filter and / or external filter are applied along with a column filter, each filter type is considered and the row will only show if it passes all three types.
Column filters are tied to a specific column. Quick filter and external filter are not tied to any particular column. This section of the documentation talks about column filters only. For quick filter and external filter, click the links above to learn more.
There are four filters that are provided by the grid. These are as follows:
|A Number Filter for number comparisons.|
|A Text Filter for string comparisons.|
|A Date Filter for date comparisons.|
|A Set Filter, influenced by how filters work in Microsoft Excel. This is an ag-Grid-Enterprise feature.|
See the Provided Filters section for more details on using them.