Skip to content

Token List Filter

Use the Token List filter when users already have an exact list of identifiers, SKUs, email addresses, or other scalar values. They can paste comma-, newline-, or tab-separated text instead of selecting values from the column.

Source code
TypeScriptts
grid.plugins = [AdvanceFilterPlugin];
grid.columns = [
  { prop: 'sku', name: 'SKU', filter: ['string', FILTER_TOKEN_LIST] },
];
grid.filter = true;

return [
  { sku: 'EU-100' },
  { sku: 'EU-200' },
  { sku: 'US-500' },
  { sku: 'AP-300' },
];

AdvanceFilterPlugin registers the built-in body. Add FILTER_TOKEN_LIST to the column’s filter families:

import { AdvanceFilterPlugin, FILTER_TOKEN_LIST } from '@revolist/revogrid-pro';
import '@revolist/revogrid-pro/dist/revogrid-pro.css';
grid.plugins = [AdvanceFilterPlugin];
grid.columns = [
{ prop: 'sku', name: 'SKU', filter: ['string', FILTER_TOKEN_LIST] },
];
grid.filter = true;

Keeping 'string' in the array also exposes the ordinary text operators. Use only FILTER_TOKEN_LIST when the popup should contain only the token workflow.

UI modeSaved operatorValue shapeMatches
Is any oftokenListAnyOfstring[]A non-null scalar whose string value is one of the tokens
None oftokenListNoneOfstring[]Any value that does not match the Is any of rule

Input is trimmed, empty tokens are removed, duplicates keep their first position, and comparisons are exact and case-sensitive. Objects and functions never match Is any of. The body does not scan source rows, so it is also suitable when the complete value list comes from outside the grid.

Use the operator ID—not FILTER_TOKEN_LIST—inside multiFilterItems:

grid.filter = {
multiFilterItems: {
sku: [
{
id: 1,
type: 'tokenListAnyOf',
value: ['EU-100', 'EU-200', 'US-500'],
relation: 'and',
},
],
},
};

Assign an empty multiFilterItems object to clear restored filters:

grid.filter = { multiFilterItems: {} };
  • Pasting EU-100, EU-200\nUS-500 creates three tokens.
  • Numeric and boolean cell values are compared through their string representation.
  • The condition value is a JSON-safe array and can be transported with the canonical filter AST.
  • Removing every token removes the owned condition instead of saving an empty no-op filter.
  • Do not save type: 'tokenList'; that is the body ID. Save tokenListAnyOf or tokenListNoneOf.
  • Do not expect fuzzy or case-insensitive matching. Use the Fuzzy Search filter for approximate text.
  • Do not pass one comma-containing value when commas are meaningful inside the value; pasted commas are delimiters.