Skip to content

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' },
];
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],
},
];
Default labelSaved operator IDMatches
Is empty arrayisEmptyArrayArrays with length === 0
Is not empty arrayisNotEmptyArrayArrays 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.