View as Markdown

Filtering

Filtering

The filter row, menu, checklist and Excel filter UIs, operators, initial and nested filters, case and accent matching, filter methods and server-side filtering.

filtering turns filtering on: true for the defaults, or a DataGridFiltering object. Filtering is a core pipeline stage, so the filter state lives in the engine and survives virtual scrolling, sorting and grouping. A column opts out with filterable: false.

Filter row

The default UI, filtering.ui: 'row', is a row of labelled inputs under the header. A plain value uses the column's default operator (contains for strings, equal otherwise). An operator prefix picks another one: >=, <=, >, <, =, != or <>; * and % in string text are wildcards, so Lyo* is a like condition. Escape clears the cell. Invalid text, for example letters in a number column, marks the input aria-invalid and keeps the previous filter. A filter set elsewhere (the initial filtering.filters, a menu or a method) is written into the cell with its operator prefix (>=50), a between range as 100..500, and the cell is marked data-filtered; Enter on that text keeps the condition, also for operators without a prefix such as startsWith.

filtering.showOperators adds an operator dropdown to each cell, which replaces the prefixes; with between the cell is a text input that takes from..to. filtering.trigger decides when a cell applies: 'enter' (the default) on Enter, 'input' while typing, after filtering.debounce milliseconds (default 1500). A column's renderFilterCell(ctx) replaces its cell, for example with a select; the context carries the column, the applied value and operator, and apply, setValue and clear.

With the filter row and paging, the pager shows the applied filters on a line under its controls, for example "Filtered by Country: Equal Japan; Amount: Greater than or equal 200". It lists every condition, whatever set it, flattens nested groups and shortens an in list after five values; the initial filters are part of the server render. filtering.showStatus: false hides it. The message belongs to the pager: a grid without paging, a renderPager template or the menu UIs show none. The text comes from the localeText keys filterStatus ({conditions}), filterStatusCondition ({column}, {operator}, {value}) and filterStatusSeparator.

Filter row

Open demo

A filter row with operator prefixes and wildcards, an operator dropdown, Enter or while-typing triggers, case and accent switches, a cell template, a lookup column filtered by its display text, initial and nested AND/OR filters, filter methods and a non-filterable column.

Order
Customer
City
Country
Category
Amount
Shipped
Note (not filterable)
ORD-10000
José Álvarez
Lyon
France
Loose tea
$75.86
ORD-10001
Zoë Laurent
Berlin
Germany
Coffee beans
$107.10
ORD-10002
Chloé Dubois
Osaka
Japan
Brewing equipment
$612.75
Leave the parcel with the building reception if nobody answers the door.
ORD-10003
jose alvarez
Penang
Malaysia
Brewing equipment
$519.20
ORD-10004
Renée Roy
Penang
Malaysia
Loose tea
$55.50
Gift wrap
ORD-10005
André Silva
Osaka
Japan
Loose tea
$105.45
ORD-10006
Noël Martin
Tokyo
Japan
Coffee beans
$74.00
ORD-10007
Ana Muñoz
Osaka
Japan
Coffee beans
$130.90
ORD-10011
jose alvarez
Munich
Germany
Loose tea
$68.85
ORD-10013
André Silva
Osaka
Japan
Loose tea
$130.05
ORD-10014
Noël Martin
Lyon
France
Brewing equipment
$519.20
Call before delivery
ORD-10015
Ana Muñoz
Kuala Lumpur
Malaysia
Brewing equipment
$367.65
ORD-10016
José Álvarez
Reims
France
Brewing equipment
$348.30
Leave the parcel with the building reception if nobody answers the door.
ORD-10017
Zoë Laurent
Penang
Malaysia
Loose tea
$111.00
ORD-10018
Chloé Dubois
Penang
Malaysia
Brewing equipment
$645.00
ORD-10019
jose alvarez
Osaka
Japan
Coffee beans
$59.50
Call before delivery
ORD-10021
André Silva
Penang
Malaysia
Brewing equipment
$340.20
ORD-10022
Noël Martin
Reims
France
Loose tea
$102.00
ORD-10023
Ana Muñoz
Penang
Malaysia
Coffee beans
$140.00
Gift wrap
ORD-10024
José Álvarez
Porto
Portugal
Brewing equipment
$496.49

Type in the filter row and press Enter: >=500, !=France and Lyo* pick other operators.

No events yet.

Filter menus

filtering.ui: 'menu' puts a filter button in each header that opens a filter dialog with an operator and a typed value. 'checklist' lists the column's distinct values with checkboxes, and 'excel' combines the checklist with a custom filter of up to two conditions joined by And or Or. Alt+↓ on a focused header opens the dialog; Escape closes it and returns focus to the header. A column's filter.ui overrides the grid-wide UI, and filtering.headerButton: false hides the header buttons when the dialogs are opened only from the column menu or api.openFilterMenu(field).

<DataGrid
  data={orders}
  columns={[
    { field: 'customer', header: 'Customer' },
    { field: 'country', header: 'Country', filter: { ui: 'checklist' } },
    { field: 'amount', header: 'Amount', type: 'number', filter: { operator: 'greaterThanOrEqual' } },
  ]}
  filtering={{ ui: 'excel', filters: [{ field: 'country', operator: 'in', value: ['Japan', 'France'] }] }}
  onFilterChange={(event) => console.log(event.filters)}
/>

The value editors follow the column type: text, number (with From and To for between), date, date and time, and a true/false select for booleans. A column's filter.editorProps passes attributes such as min, max and placeholder to the built-in editors, and renderFilter(ctx) replaces the value editor with your own, for example a dropdown.

The checklist has a search box that narrows the list, a Select All checkbox with a mixed state, one Blanks entry for empty and missing values, and the row count of each value. The counts exclude the column's own filter, so unchecked values stay listed. The list requests filtering.checklistPageSize values at a time (default 100) and the next batch as it scrolls to its end; filtering.checklistInfiniteScroll: false requests every value at once. The list is virtualized either way, and Select All or a single toggle applies to values that are not loaded yet. Custom filter UIs read the same distinct values and counts with getColumnFacet(field, options).

Filter menus

Open demo

Menu, checklist and Excel filter UIs with typed value editors, a per-column UI and operator list, a custom menu editor, a custom filter comparer, checklist search, Select All, blanks and counts, and a checklist that loads 50 values at a time, plus the filter menu open events with a cancellable before-event.

Order
Customer
Country
Category
Qty
Amount
Placed
Placed at
Shipped
Note
ORD-10000
Chen Wei
Malaysia
Equipment
8
$877.20
Aug 1, 2026
Aug 1, 2026, 22:35
Gift wrap
ORD-10001
Ines Duarte
Germany
Equipment
5
$645.00
Dec 3, 2026
Dec 3, 2026, 16:13
Call before delivery
ORD-10002
Dewi Lestari
Malaysia
Equipment
1
$129.00
Nov 21, 2026
Nov 21, 2026, 05:36
ORD-10003
Bao Nguyen
Japan
Coffee
5
$83.25
Feb 3, 2026
Feb 3, 2026, 23:51
ORD-10004
Hana Sato
France
Coffee
9
$126.00
May 22, 2026
May 22, 2026, 01:28
ORD-10005
Elif Kaya
Malaysia
Tea
7
$64.75
Dec 27, 2026
Dec 27, 2026, 23:13
ORD-10006
Goran Petrov
Portugal
Equipment
6
$369.93
Nov 18, 2026
Nov 18, 2026, 17:29
Call before delivery
ORD-10007
Goran Petrov
Japan
Coffee
2
$28.00
May 22, 2026
May 22, 2026, 13:33
ORD-10008
Dewi Lestari
Japan
Coffee
10
$126.00
Jan 5, 2026
Jan 5, 2026, 11:32
ORD-10009
Goran Petrov
Germany
Tea
11
$140.25
Nov 21, 2026
Nov 21, 2026, 23:46
ORD-10010
Chen Wei
Japan
Coffee
8
$140.60
May 20, 2026
May 20, 2026, 05:47
ORD-10011
Farah Aziz
Germany
Tea
9
$83.25
Nov 18, 2026
Nov 18, 2026, 08:43
ORD-10012
Dewi Lestari
Japan
Equipment
3
$175.23
Jan 7, 2026
Jan 7, 2026, 08:51
ORD-10013
Bao Nguyen
Portugal
Coffee
5
$92.50
Jun 20, 2026
Jun 20, 2026, 22:16
Leave the parcel with the building reception if nobody answers the door.
ORD-10014
Ines Duarte
Germany
Equipment
3
$107.10
Sep 4, 2026
Sep 4, 2026, 23:36
ORD-10015
Ines Duarte
Japan
Coffee
11
$130.90
May 18, 2026
May 18, 2026, 23:43
Gift wrap
ORD-10016
Hana Sato
Malaysia
Equipment
3
$119.70
Apr 8, 2026
Apr 8, 2026, 09:15
ORD-10017
Dewi Lestari
Germany
Equipment
4
$168.00
Sep 18, 2026
Sep 18, 2026, 20:13
Leave the parcel with the building reception if nobody answers the door.
ORD-10018
Hana Sato
Germany
Equipment
1
$122.55
Sep 24, 2026
Sep 24, 2026, 17:06
ORD-10019
Dewi Lestari
Japan
Tea
12
$137.70
Jul 8, 2026
Jul 8, 2026, 23:53

Open a header's filter button, or focus a header and press Alt+↓.

No events yet.

Operators

String columns offer contains, startsWith, endsWith, doesNotContain, doesNotStartWith, doesNotEndWith, isEmpty and isNotEmpty. Every type has equal and notEqual; numbers and dates add greaterThan, greaterThanOrEqual, lessThan, lessThanOrEqual and between with a [from, to] value. isNull, isNotNull, in and notIn (with an array value) work on every type, and like (with % and *) and wildcard match patterns. The core also accepts the lowercase spellings (startswith).

filtering.operators sets the operators offered per column type, in order, with the first as the default; a column's filter.operators overrides it for that column and filter.operator sets its default.

Custom comparer

A column's filterComparator(value, filterValue, operator) replaces the built-in test for every built-in operator on that column. It receives the raw cell value, the condition's value (an array for between, in and notIn) and the operator in its camelCase name, and returns true when the cell matches. The comparator owns the comparison, so matchCase and ignoreAccents are not applied to its inputs. It runs once per distinct cell value, not once per row, so it must not read other fields of the row; a longer value never narrows the previous result. Columns without a comparator keep the built-in path. The comparator runs on local data only: a remote source receives the condition as usual. Custom operators registered with the filter module keep their own function.

const squash = (v: unknown) => String(v ?? '').toLowerCase().replace(/[\s-]+/g, '');
const columns: DataGridColumn<Order>[] = [
  {
    field: 'customer',
    filterComparator: (value, filterValue, operator) =>
      operator === 'contains' ? squash(value).includes(squash(filterValue)) : squash(value) === squash(filterValue),
  },
];

Filter state and methods

filtering.filters holds the active filters as DataGridFilter[]: conditions { field, operator, value, logic, matchCase, ignoreAccents } and nested groups { logic, filters }. A group's logic combines its members: (A OR B) AND C is [{ logic: 'or', filters: [A, B] }, C], and groups nest; not: true negates a group. A condition's logic (default 'and') joins it to the previous condition on the same column at the top level; inside a group it is ignored. Top-level columns and groups are ANDed. The prop is reactive: a new value replaces the filters, and the initial value is part of the server render. onBeforeFilterChange can cancel a change with preventDefault(); onFilterChange reports the applied filters, the previousFilters and the field.

field in a condition is the column id (its id, else its field), so two columns over the same field filter independently.

api.filterColumn(field, operator, value, { logic, matchCase, ignoreAccents }) replaces a column's conditions; an array value with a single-value operator ORs one condition per value. clearFiltering(fields?) removes the filters of the given columns or all of them, and removeFilter(field) removes one column's filters. getFilteredRows() returns the rows that pass the search and every filter, in sort order and across every page. It is synchronous and returns the same array while the rows, filters and sort are unchanged. With a remote source that filters, the server holds the filtered rows, so getFilteredRows() returns the rows the grid loaded: the current page when the server pages, every filtered row when it does not. To get every filtered row of a server-paged source, read them from your data source with the current query.

Filter status and filtered rows

Open demo

The pager's filter status message for the filter row (on by default, switchable with filtering.showStatus) and getFilteredRows() reading the filtered rows across every page.

Order
Customer
Country
Product
Amount
ORD-10038
Elif Kaya
Japan
Grinder
$438.60
ORD-10060
Bao Nguyen
Japan
Kettle
$678.21
ORD-10084
Chen Wei
Japan
Pour-over kit
$399.00
ORD-10088
Aiko Tan
Japan
Grinder
$1,161.00
ORD-10097
Jun Park
Japan
Grinder
$767.55
ORD-10104
Ines Duarte
Japan
Kettle
$292.05
ORD-10115
Goran Petrov
Japan
Kettle
$642.51
ORD-10118
Elif Kaya
Japan
Grinder
$774.00
ORD-10135
Chen Wei
Japan
Pour-over kit
$428.40
ORD-10137
Bao Nguyen
Japan
Pour-over kit
$321.30

Filter in the row (press Enter), then read the filtered rows.

Filter builder

filtering.builder adds an advanced filter builder: a dialog that edits the whole filter tree as nested AND/OR groups of conditions. Each group has an And / Or choice, Add condition, Add group and (below the root) Remove group buttons; each condition picks a field, an operator from the column's list and a typed value. OK applies the tree as one filter change, Clear empties the draft and Cancel or Escape closes the dialog without applying. The dialog is modal: Tab stays inside it, and focus returns to the toolbar button or the grid on close.

There is no second rule model: the builder reads and writes filtering.filters, so the groups it builds are the DataGridFilter groups above and the filter row or menus keep working on the same state. Open it with the 'filterBuilder' toolbar item or api.openFilterBuilder(), and close it with api.closeFilterBuilder(). The field list offers the filterable visible columns; builder: { includeHidden: true } adds the hidden ones. onBeforeFilterBuilderOpen receives the applied filters and cancels the opening with preventDefault(); the applied change reports through onBeforeFilterChange / onFilterChange with ui: 'builder'.

The dialog code is a lazy chunk: a grid without filtering.builder never downloads it, and one with it preloads the chunk after mount.

The builder edits the same filtering.filters tree (DataGridFilter[]) as every other filter UI, so there is no separate rule API: read the applied tree from onFilterChange, onBeforeFilterBuilderOpen or getState().filters, clear it with clearFiltering(), and open or close the dialog with openFilterBuilder() / closeFilterBuilder(). | advancedFilterComplete | onFilterChange with ui: 'builder' |

Filter builder

Open demo

The advanced filter builder dialog over nested AND/OR filter groups, opened from the toolbar item or api.openFilterBuilder(), with hidden columns offered through includeHidden, a cancellable onBeforeFilterBuilderOpen and filter events reporting ui: 'builder'.

Order
Customer
Country
Category
Qty
Amount
Placed
Shipped
ORD-10001
Bao Nguyen
Japan
Equipment
9
$378.00
Jan 18, 2026
ORD-10005
Bao Nguyen
Malaysia
Equipment
7
$279.30
Sep 23, 2026
ORD-10007
Elif Kaya
Malaysia
Equipment
11
$1,419.00
Nov 26, 2026
ORD-10010
Ines Duarte
Malaysia
Equipment
8
$519.20
Jun 22, 2026
ORD-10020
Goran Petrov
Malaysia
Equipment
6
$226.80
Feb 2, 2026
ORD-10023
Bao Nguyen
Malaysia
Tea
10
$127.50
May 28, 2026
ORD-10025
Hana Sato
Japan
Equipment
2
$245.10
Apr 20, 2026
ORD-10030
Farah Aziz
Malaysia
Equipment
6
$350.46
Sep 17, 2026
ORD-10031
Hana Sato
Malaysia
Equipment
4
$246.62
Oct 28, 2026
ORD-10034
Goran Petrov
Japan
Equipment
7
$857.85
Aug 6, 2026
ORD-10038
Goran Petrov
Malaysia
Equipment
9
$584.10
Dec 12, 2026
ORD-10039
Hana Sato
Malaysia
Equipment
4
$516.00
Jul 19, 2026
ORD-10041
Hana Sato
Japan
Coffee
12
$159.60
Jun 27, 2026
ORD-10043
Goran Petrov
Malaysia
Equipment
4
$246.62
Oct 12, 2026
ORD-10046
Goran Petrov
Japan
Equipment
11
$642.51
May 7, 2026
ORD-10056
Goran Petrov
Malaysia
Equipment
10
$420.00
Oct 8, 2026
ORD-10057
Jun Park
Japan
Equipment
5
$645.00
Oct 24, 2026
ORD-10058
Aiko Tan
Malaysia
Equipment
10
$1,161.00
May 17, 2026
ORD-10062
Ines Duarte
Japan
Equipment
6
$369.93
May 23, 2026
ORD-10064
Goran Petrov
Malaysia
Coffee
10
$133.00
Feb 28, 2026
No events yet.

Lookup columns

A lookup column filters by its display text, not by the key stored in the row: typing "loose" in the demo's Category cell finds the rows whose key is Tea, and the checklist lists the names. See Lookup columns.

Case and accents

Matching ignores case by default; filtering.matchCase makes it case-sensitive and a condition's matchCase overrides it. filtering.ignoreAccents folds accents before comparing, so "jose" matches "José"; a condition's ignoreAccents overrides it.

Server-side filtering

With a remote data source the filters, including nested groups, are part of every read request; the server applies them, and the grid shows its result. The demo's request log shows the wire query as the filter row, the toolbar search and the pager change.

The checklist and excel UIs read their values from the server too. The core computes facets over local rows only, so getColumnFacet answers status: 'unavailable' for a remote source that filters; the filter dialog then asks the data source with read({ facet: { columnId, search, limit } }). The request carries the current query, the server counts each value over the rows that pass the search and every other column's filter, and answers facet with the entries sorted by label and complete: false when limit cut the list. The dialog requests filtering.checklistPageSize values first and raises the limit by a page as the list scrolls to its end; typing in its search box sends a narrowed request after 250 ms, each request aborts the previous one, and closing the dialog aborts the last. OK with values that are not loaded yet sends one more facet request for every value before applying. A source without capabilities.facets shows "Filter is not available". While the first values load, the dialog shows placeholder value rows; filtering.loadingIndicator: 'spinner' shows a spinner instead. Both are one role="status" element with the "Loading…" text for assistive technology. createJsonDataSource and the reference handler support facets; the demo's Customer column uses an Excel filter over the remote source.

Server-side filtering and search

Open demo

A remote JSON source receiving the filter row (with an initial nested AND/OR group), the toolbar search and the page in one request, and an Excel filter whose values come from paged, searchable facet requests (with a skeleton or spinner while they load); the request log shows the wire query.

Order
Customer
Country
Product
Qty
Amount

Filter, search or page: each change is one request carrying the whole query.

No events yet.

Filter events

onBeforeFilterChange / onFilterChange report every filter change, from the UI or a method (see above). The filter dialogs have their own pair: onBeforeFilterMenuOpen fires before a menu, checklist or Excel dialog opens and cancels the opening with preventDefault(); onFilterMenuOpen fires once the dialog rendered. Both receive { field, ui, dialog }: ui is the dialog's filter UI ('menu', 'checklist' or 'excel') and dialog is 'menu' for the dialog itself or 'custom' when the Excel filter's custom-condition section opens. The filter menus demo above logs both events and can cancel the Note column's menu.

API reference

See DataGridFiltering, DataGridColumnFilter, DataGridFilterCondition, DataGridFilterGroup, DataGridFilterContext and DataGridFilterChangeEvent in the API reference.