Array Filter
The Pro Array Filter adds two valueless operators for array-valued cells. Add
AdvanceFilterPlugin and use the array family:
Source code
TypeScriptts
grid.plugins = [AdvanceFilterPlugin];
grid.columns = [
{ prop: 'item', name: 'Item' },
{ prop: 'tags', name: 'Tags', filter: [FILTER_ARRAY] },
];
grid.filter = true;
return [
{ item: 'Backlog', tags: [] },
{ item: 'Launch', tags: ['priority', 'release'] },
{ item: 'Legacy import', tags: 'unavailable' },
];Quick start
Section titled “Quick start”import { AdvanceFilterPlugin, FILTER_ARRAY } from '@revolist/revogrid-pro';import '@revolist/revogrid-pro/dist/revogrid-pro.css';
grid.plugins = [AdvanceFilterPlugin];grid.columns = [ { prop: 'tags', name: 'Tags', filter: [FILTER_ARRAY], },];Operators
Section titled “Operators”| Default label | Saved operator ID | Matches |
|---|---|---|
| Is empty array | isEmptyArray | Arrays with length === 0 |
| Is not empty array | isNotEmptyArray | Arrays with length > 0 |
Non-arrays match neither operator. Sparse arrays use their actual length, so
new Array(3) is non-empty. The operators need no filter value and remain
visibly active when restored from multiFilterItems.
grid.filter = { multiFilterItems: { tags: [ { id: 0, type: 'isEmptyArray', relation: 'and', }, ], },};Expressions support empty array, not empty array, is empty array, and is not empty array. See Blank Values for the
separate configurable blank policy. With emptyArray: true, [] explicitly
matches both the Core blank operator and isEmptyArray.