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:

PropertyDescriptionDefault
availableFilterEditorsWhich UI Components can be used to edit a Grid Filter: Expression Editor, Query Builder (or both)['ExpressionEditor', 'QueryBuilder']

Grid Filter API

MethodDescription
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:

PropertyDescription
gridFilterCurrent Grid Filter
gridFilterExpressionASTAST for Current Grid Filter Expression
adaptableContextCustom 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
});