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 the Grid Filter is 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:

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

Grid Filter API

MethodReturnsDescription
clearGridFilter()voidClears the Grid Filter (for the current Layout)
getCurrentGridFilter()GridFilter | undefinedRetrieves the Grid Filter from the current Layout
getCurrentGridFilterExpression()string | undefinedRetrieves the Grid Filter's Expression from the current layout
openUIEditorForGridFilter(expression)voidOpens the AdapTableQL UI Components (Expression Editor & Query Builder)
reApplyGridFilter()voidRe-applies the Grid Filter
setGridFilterExpression(expression)voidSets the Grid Filter (for the current layout)
setGridFilterExpressionUsingNamedQuery(namedQuery)voidSets the Grid Filter (for the current layout)
suspendGridFilter()voidSuspends the Grid Filter
unSuspendGridFilter()voidUnsuspends 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:

PropertyTypeDescription
gridFilterGridFilter | undefinedCurrent Grid Filter
gridFilterExpressionASTanyAST for Current Grid Filter Expression
adaptableContextanyCustom 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
});