Skip to content

Commit eba51aa

Browse files
authored
Merge pull request #643 from nowcommunity/filter-mode-docs
Add docs for column filter mode menu
2 parents e57607e + b56a909 commit eba51aa

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

documentation/frontend/components/TableView.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ Following things are needed to create a new page with a table (examples are all
2424
- Table view:
2525
The [TableView](../../../frontend/src/components/TableView/TableView.tsx) is defined via variables columns and visibleColumns. Columns in the most simple form only require an accessorKey and a header. If an accessorFn is used, a separate id is required as well. The accessorkey functions as a key to fetch data as well as an id to reference the column as well. The variable visibleColumns takes in accessorKeys or ids for columns, set to false, to be hidden by default.
2626
- Non-default filtering (eg filterVariant 'range' for numbers or filterFn 'contains' for text substrings) require no null values in the data for given column. It is needed to use accessorFn to map nulls to an empty string for example.
27-
- non-hideable columns can be set by setting parameter `enableHiding: false`
27+
- non-hideable columns can be set by setting parameter `enableHiding: false`.
28+
- to enable a filter mode selection menu for the columns of the table, set paramater `enableColumnFilterModes` to `true`
29+
- you can pass an array of filter functions to be shown in the menu to the parameter `columnFilterModeOptions`
30+
- it's a good idea to disable the filter mode menu for columns for which it doesn't make sense by setting the parameter `enableColumnFilterModes` to `false` for that column. See [LocalityTable](../../../frontend/src/components/Locality/LocalityTable.tsx) for an example
31+
- for more information, see [MRT docs filter mode section](https://www.material-react-table.com/docs/guides/column-filtering#filter-modes)
2832

2933
More info can be found from official [MRT docs](https://www.material-react-table.com/)

0 commit comments

Comments
 (0)