Configuring Column Filters
Summary
- Column Filtering in AdapTable includes advanced features for more demanding use cases
- These are primarily available in Column Filter Options and allow developers to configure Filtering as needed
AdapTable provides many configuration options which allow developers to set up Column Filtering to meet precise requirements.
Most of these are available in the Column Filter Options section of Adaptable Options.
Find Out More
- This page lists some general Column Filtering options
- See Filter Components and In Filter for options to configure those UI Filter Components
Non Filterable Rows
By default all data rows in AdapTable will be evaluated in Column Filtering.
Occasionally, the use case arises where some rows should always be present and never subject to filtering.
This can be configured using the isRowFilterable property in Column Filter Options.
isRowFilterable
Default: trueboolean- In this example we provide an implementation for
isRowFilterableproperty, so these rows are never filtered:- the first row in the Grid
- any row where
Languageis 'HTML'
- We filter the
Languagecolumn on 'TypeScript' but still see "JavaScript" for theLanguagecolumn in first row, and see 'HTML' as those rows are excluded from filtering
Non Filterable Rows
Filtering on Special Columns
By default, AdapTable allows all Calculated Columns and FreeText Columns to be filterable.
This behaviour can be changed via the enableFilterOnSpecialColumns property in Filter Options.
enableFilterOnSpecialColumns
Default: truebooleanClearing Column Filters on Startup
AdapTable always saves previously applied Column Filters (and the Grid Filter) into AdapTable State (via the Current Layout).
It will then automatically re-apply these Filters when the Application is reloaded.
If this behaviour is not desired, set the clearFiltersOnStartUp property in Filter Options to true.
clearFiltersOnStartUp
Default: falsebooleanFiltering when Data Changes
By defaul AdapTable automatically and immediately re-applies all Filters whenever data changes in AG Grid.
Note
This includes both types of data changes - User Edit or Underlying Data Ticking.
Developers can amend this behaviour via the filterActionOnDataChange property in Filter Options.
Automatic re-filtering can be turned off altogether, or a Throttle can be applied.
Caution
- AG Grid automatically re-applies filters (effectively bypassing this property) if the Grid data is updated using:
applyTransactionin AG Grid's GridAPIupdateDataormanageGridDatain Adaptable GridAPI
Indicating Filtered Columns
AdapTable distinctively renders the Column Header for any currently filtered columns.
Note
This is particularly helpful when users restart the application, unaware that filters were persisted
In the rare case that this is not desired behaviour, set the indicateFilteredColumns property to false.
indicateFilteredColumns
Default: truebooleanColumn Filter Applied Event
AdapTable will fire the Column Filter Applied Event whenever a Column Filter changes.
This allows you to listen to Column Filters which have changed in AdapTable and react accordingly.
Hint
This is often used when wanting to evaluate expressions on the Server
- In this example we listen to the Column Filter Applied Event and output the Event's info to the console
- Create a Column Filter and inspect the Console to see the output from the Event