AdapTable Grid Filter
Summary
- The Grid Filter searches the grid’s data and shows only matching rows
- It is a property of a Layout and complements (and can be used together with) Column Filters
- Grid Filters wrap (Boolean) Expressions which are evaluated by AdapTableQL
- Boolean Expressions can contain multiple conditions and operators and reference numerous columns
- Grid Filters can be named and saved as Named Queries and then re-run as often as required
The AdapTable Grid Filter allows users to run complex, multi-condition searches across multiple Columns.
These will then be evaluated across the whole of AG Grid's data source.
Note
- Grid Filters complement, and are designed to work in conjunction, with Column Filters
- Both Grid and Column Filters can be active at the same time
AdapTable will display only those rows that match all the Conditions in the Grid Filter.
Hint
Grid Filters differ from Quick Search in that they display matching rows, rather than highlight matching cells
The Grid Filter is saved (and can be defined) in the Current Layout.
Caution
- There can only be one active Grid Filter at any time
- Unlike Calculated Columns which can return any value, Grid Filter Expressions must always return a Boolean
Expressions
Grid Filters are essentially wrappers around Boolean Expressions - powerful, configurable, querying constructs that can contain multiple conditions and operators and will return a boolean (true/false) result.
As with all Expressions, Grid Filters are evaluated by AdapTableQL - AdapTable's native Query Language.
AdapTable provides two UI components to facilitate the creation of the Grid Filter Expression:
- a Query Builder for straightforward Expressions
- an Expression Editor for more complex requirements
Hint
The Grid Filter Toolbar works especially well when Pinned above the Grid
Both open in the Settings Panel (via the Expand button, or by clicking the expression summary in the Toolbar).
Note
Once created, the Expression is shown as a summary in the Grid Filter Toolbar (it is not edited in place)
- This example runs a Grid Filter which returns the most popular JavaScript packages
- The Grid Filter Toolbar has been Pinned so it sits above the Grid
- Click the Expand button (the 2 arrows) on the left of the Toolbar — or click the expression summary — to open the Grid Filter in the Settings Panel, where the Query Builder and Expression Editor are available
Named Queries
Grid Filters are typically created on the fly, evaluated immediately, and then cleared when no longer needed.
However, if required, Grid Filter Expressions can be named and saved in order to be re-used at a later date.
In this scenario it is called a Named Query and persisted into the NamedQuery section of Adaptable State.
It will then be available for loading at a later point in time (in this or future sessions).
Find Out More
See Named Queries for full details on this topic
Comparing Columns
One advantage of the Grid Filter over Column Filters is that it can be used to compare values in 2 Columns.
This can be done in both the Query Builder and the Expression Editor.
Note
Only rows where this grid-filter expression is true are shown (the expression may compare two or more columns in one rule).
- This example runs a Grid Filter which compares 2 sets of Columns
- The Expression is:
[closed_issues_count] > [closed_pr_count] AND [pushed_at] = [updated_at]
- Open the Grid Filter in the Settings Panel (Expression Editor or Query Builder) to see how the Columns are compared
Grid Filter with Column Filters
The Grid Filter can be applied simultaneously with any Column Filters.
Note
Only rows which pass both sets of evaluation will be displayed in the Grid
- This example runs a Grid Filter as well as 4 Column Filters
- Only the 3 rows which pass both sets of evaluations are displayed
Managing the Grid Filter
The Grid Filter is accessible to both design-time and run-time users as follows:
- Developers can define a GridFilter (using the
GridFilterproperty in the Layout Definition) - Developers can configure the GridFilter to match custom requirements
- Run-time users can use (ie. set, edit, clear, save, reload etc) the Grid Filter
Find Out More
See Managing the Grid Filter for more information
UI Entitlements
The UI Entitlements behaviour for Grid Filter is as follows:
-
Full- Grid Filters can be created, edited, cleared, suspended and saved; the UI components are available and display normally -
Hidden- No Grid Filter UI components are visible or available -
ReadOnly- The current Grid Filter Expression is visible in the Toolbar / Tool Panel, but it cannot be edited, cleared, suspended or saved
FAQ
Can we evaluate Grid Filters on the server?
Yes, via the evaluateAdaptableQLExternally property in Expression Options (see Server Evaluation for more details)
Caution
This option is only available if you are using the AG Grid Client Side Row Model
Can we re-use the same Grid Filter Expression in different Modules - e.g. as a Plus / Minus Rule and a Report? Yes. By saving the Grid Filter as a Named Query, you can re-use the Expression for searching, styling, reports etc.
Will the Grid Filter disappear if I run Quick Search or apply a Column Filter? No, all these different types of Searches are additive so they will all be applied individually if provided.