Custom Column Filter#

Props#

FieldTypeDescription
options.filteringbooleandisplay filter row on table
columns.filterComponentReact.Elementcustom component for filtering

FilterComponent#

The filterComponent passes these props to hook it to the table internal filtering:

FieldTypeDescription
columnDefColumnthe current column of the filter
onFilterChanged(columnId: string, value: any) => void;the callback for the onChange

Usage#

import MaterialTable from "@material-table/core";
<MaterialTable
// ...
options={{
filtering: true,
}}
/>;

Live Demo#

note

See here for more on the GLOBAL_VARS we use in our demos

Live Editor
Result