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
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' },
];Quick start
Section titled “Quick start”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.
Operators and state
Section titled “Operators and state”| UI mode | Saved operator | Value shape | Matches |
|---|---|---|---|
| Is any of | tokenListAnyOf | string[] | A non-null scalar whose string value is one of the tokens |
| None of | tokenListNoneOf | string[] | 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.
Restore a token list
Section titled “Restore a token list”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: {} };Key behavior
Section titled “Key behavior”- Pasting
EU-100, EU-200\nUS-500creates 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.
Common mistakes
Section titled “Common mistakes”- Do not save
type: 'tokenList'; that is the body ID. SavetokenListAnyOfortokenListNoneOf. - 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.