Using the Grid Filter
Grid Filter
The Grid Filter is essentially a multiple-column query which is evaluated by AdaptableQL.
It is defined in the view.filters.grid
property of the Adaptable State.
It can be used in conjuction with Column Filters as they can operate in tandem.
Hint
The Grid Filter can reference multiple columns; to reference only a single column you should use a Column Filter
In this example, we define the Grid Filter on the github_stars
and the license
columns.
const defaultState: AdaptableUserState = {
globalEntities: {
// ...
},
view: {
currentViewId: 'myView',
views: [
{
id: 'myView',
label: 'My View',
filters: {
grid: `[github_stars] > 40000 AND [license] CONTAINS "MIT"`,
},
},
],
},
};
Controlled State
The Grid Filter value can be controlled from outside by using controlled AdaptableState.
In this way, you can implement your own UI to control the grid filter value and pass it down to Adaptable via controlled state.
Controlling the grid filter value from outside
In this demo, we use controlled AdaptableState to control the grid filter value from outside.