How can I add filters like (equals, starts with, ...)? #5219
Replies: 3 comments 1 reply
-
declare module '@tanstack/table-core' {
interface FilterFns {
myCustomFilter: FilterFn<unknown>
}
}
const column = columnHelper.data('key', {
filterFn: 'myCustomFilter',
})
const table = useReactTable({
columns: [column],
filterFns: {
myCustomFilter: (rows, columnIds, filterValue) => {
// return the filtered rows
},
},
}) Map your filters to accordingly functions then pass them to useTable hook
Then you may need some custom api like |
Beta Was this translation helpful? Give feedback.
-
Can anyone point me in the right direction for this? What would the filter functions look like? |
Beta Was this translation helpful? Give feedback.
-
I am working Material react table . If code is good please give one like
//filterFn is mandatory when page load it set contains to that field const [columnFilterFns, setColumnFilterFns] = useState( onColumnFiltersChange: (updater) => {
|
Beta Was this translation helpful? Give feedback.
-
Hi, how can I create filters such as equals, contains, starts with, ends with, between, greater than, greater than or equal to, less than, and less than or equal to?"
like this:
Does anyone have an example repository? The docs are not helpful.
Beta Was this translation helpful? Give feedback.
All reactions