DevExtreme v23.1 is now available.
Explore our newest features/capabilities and share your thoughts with us.
The DataGrid includes the following API you can use to filter data:
filter() / filter(filterExpr)
Gets or sets a filter expression for the grid's dataSource.
filterValue
A filter expression that is applied with the following UI elements: filter row, header filter, filter builder.
getCombinedFilter() / getCombinedFilter(returnDataField)
Gets the total filter that includes filters from the UI elements and the filter applied to the dataSource. If you specify the returnDataField
parameter, the returned value contains data field names instead of getters.
clearFilter() / clearFilter(filterName)
Discards all filters applied to the DataGrid. If you specify the filterName
parameter, this method discards all filters of a specific type.
In this demo, you can use the SelectBox component to filter the grid's dataSource. The "All" item calls the clearFilter() method and the other items call the filter(filterExpr) method.