Filter Expressions
The Pro advanced filter can expose an optional expression editor inside each filter popup. It is disabled by default. When enabled, the popup adds an Expression button and expandable editor panel at the bottom, after the regular filter controls. Users can type current-column filter logic as text; valid expressions apply live and compile into the grid’s standard multiFilterItems model.
import { AdvanceFilterPlugin } from '@revolist/revogrid-pro';
const grid = document.createElement('revo-grid');
grid.plugins = [AdvanceFilterPlugin];grid.columns = [ { prop: 'status', name: 'Status', filter: ['string', 'selection'] }, { prop: 'score', name: 'Score', filter: ['number', 'slider'] }, { prop: 'updated', name: 'Updated', filter: ['date'] },];
grid.filter = { expressions: { enabled: true, applyDebounceMs: 300, buttonLabel: 'Expression', placeholder: 'between 10 and 50\ncontains "north" AND not empty', },};Current-column scope
Section titled “Current-column scope”Expressions are scoped to the column whose filter popup is open. You can omit the column name:
between 2024-01-01 and 2024-12-31 AND after 2024-06-01You can also include the current column prop or name for readability:
updated between 2024-01-01 and 2024-12-31 AND updated after 2024-06-01References to another column are invalid and do not change active filters.
For application-defined cross-column OR, nested groups, and NOT, use the public Canonical Filter AST. The popup editor remains deliberately scoped to its current column.
Parsed cell values
Section titled “Parsed cell values”Expressions evaluate the current column’s parsed value when cellParser is defined, just like ordinary comparisons. Blank expression operators use the raw source value and property-presence context from Core. See Blank Values for the source-preserving contract.
Syntax
Section titled “Syntax”Use AND, OR, and parentheses to group expressions:
(contains "north" OR contains "west") AND not emptyString columns support:
emptynot empty= "Active"!= "Archived"begins "A"contains "north"not contains "draft"Array columns support strict, valueless length checks:
empty arraynot empty arrayis empty arrayis not empty arrayNumber and slider columns support:
> 10>= 25< 100<= 500between 250 and 640.42Date columns support:
equals 2024-06-01before 2024-12-31after 2024-01-01on or before 2024-12-31on or after 2024-01-01not equal 2024-07-04between 2024-01-01 and 2024-12-31todayyesterdaylast 7 daysthis monthlast monththis quarternext quarterprevious quarterthis yearnext yearprevious yearSelection-style text supports:
is "Open"in ("Open", "Pending")not in ("Closed", "Archived")Registered structured filters use the same lossless mirror without exposing their transport JSON. Objects, arrays, strings, numbers, booleans, and blank values remain typed:
structured "arrayTagsMatch" { mode: "none", values: ["renewal", "priority"], emptyOnly: false, exact: false}The editor highlights keywords, operators, properties, strings, numbers, booleans, and invalid
tokens. The grouped filter’s Text view uses the same token presentation; when a structured filter
provides describeCondition, that filter-owned readable description replaces its transport value.
Legacy saved expressions containing a quoted JSON payload remain accepted.
Validation and applying
Section titled “Validation and applying”The editor validates while users type. Valid expressions apply after applyDebounceMs; invalid expressions show diagnostics and keep the previous valid filters unchanged. Press Ctrl+Enter or Cmd+Enter to apply immediately.
The expression panel does not replace the normal popup content. Selection lists, slider controls, date inputs, and condition controls remain visible while the expression panel is expanded.
Expression filters are stored as hidden Pro filter items, so reset, active header state, filter events, and server-side filter payload handling continue to use the standard multiFilterItems flow.
Localization
Section titled “Localization”Expression labels use the existing filter localization path:
grid.filter = { expressions: true, localization: { captions: { expressionButton: 'Expression', expressionTitle: 'Filter expression', expressionPlaceholder: 'contains "north"', expressionApply: 'Apply', expressionInvalid: 'Invalid expression', }, },};