Skip to content
This repository was archived by the owner on Jan 5, 2023. It is now read-only.
Discussion options

You must be logged in to vote

I'm assuming you're asking about our Table component. You can pass a function to the filter field in the column.

{
  id: "my-coiumn",
  Header: "My column",
  accessor: "my-column",
  fieldType: "text",
  Filter: tableFilters.TextFilter(),
  filter: customFilterFn
},
const customFilterFn = React.useCallback((rows, columnIds, filterValue) => {
  // do regex here and return the filtered array
  return rows;
}, []);

For more info, check out react-table-v7 docs: https://react-table-v7.tanstack.com/docs/api/useFilters#usefilters

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@candcconsulting
Comment options

Answer selected by candcconsulting
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants