setFilterValue - Sets the filter but does not put value in the column filter field. #156
Unanswered
kscottthomas
asked this question in
Q&A
Replies: 1 comment 3 replies
-
The built-in filter textfield has its own state for performance and debouncing reasons, so this is kind of a limitation right now. There might actually be a solution though that is kind of strange. All the filterRefs are also stored on the tableInstance. You might be able to mutate its state manually. Try something like this: tableInstanceRef.current.getColumn(id).setFilterValue(value); //change value
tableInstanceRef.current.refs.filterInputRefs[id].value = value; //change internal input |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I am using the following trying to set the value in the column's filter text value see below:
tableInstanceRef.current.getColumn(id).setFilterValue(value);
Below is a snippet of the column definition:
const columns = useMemo( () => [ { accessorKey: 'FirstName', header: 'First Name', filterFn: 'startsWith', },......
Oddly this does set the filter for the table but not the value in the text field to reflect the current state. Is this a bug or not supported?
BTW: I am trying to avoid adding the <TextField component into the definition....
Thank you in Advance! Scott
Beta Was this translation helpful? Give feedback.
All reactions