Grid Filter Technical Reference
Summary
- The Current GridFilter is stored in the Layout
- Grid Filters are configured in Grid Filter Options and available at runtime through the Grid Filter API
- The Grid Filter Applied Event fires when the Grid Filter is set
Grid Filter State
There is no Grid Filter State.
Instead Grid Filters are defined as a property of a Layout in Layout Initial State.
Grid Filter Options
The properties in Grid Filter Options are used to configure the Grid Filter:
| Property | Description | Default |
|---|---|---|
| availableFilterEditors | Which UI Components can be used to edit a Grid Filter: Expression Editor, Query Builder (or both) | ['ExpressionEditor', 'QueryBuilder'] |
Grid Filter API
| Method | Description |
|---|---|
| clearGridFilter() | Clears the Grid Filter (for the current Layout) |
| getCurrentGridFilter() | Retrieves the Grid Filter from the current Layout |
| getCurrentGridFilterExpression() | Retrieves the Grid Filter's Expression from the current layout |
| openUIEditorForGridFilter(expression) | Opens the AdapTableQL UI Components (Expression Editor & Query Builder) |
| reApplyGridFilter() | Re-applies the Grid Filter |
| setGridFilterExpression(expression) | Sets the Grid Filter (for the current layout) |
| setGridFilterExpressionUsingNamedQuery(namedQuery) | Sets the Grid Filter (for the current layout) |
| suspendGridFilter() | Suspends the Grid Filter |
| unSuspendGridFilter() | Unsuspends the Grid Filter |
Grid Filter Applied Event
The Grid Filter Applied Event is triggered whenever a Grid Filter is applied in AdapTable.
Find Out More
This is often used when wanting to manage expressions on the Server
GridFilterAppliedInfo
The Grid Filter Applied Event has a GridFilterAppliedInfo object defined as follows:
| Property | Description |
|---|---|
| gridFilter | Current Grid Filter |
| gridFilterExpressionAST | AST for Current Grid Filter Expression |
| adaptableContext | Custom application Context provided in AdaptableOptions.adaptableContext |
Event Subscription
Subscribing to the Event is done the same way as with all Adaptable Events:
api.eventApi.on('GridFilterApplied', (eventInfo: GridFilterAppliedInfo) => {
// do something with the info
});