setFilter for checkbox fitlering #2350
-
I'm trying to set up filtering with checkboxes, and i struggle to omit certain values with setFilter. If i have all the boxes selected it should show all the values. but if i deselect one or more, how to filter them out? right now i have implemented just select one, but wondering if it's possible to filter out. https://codesandbox.io/s/react-table-checkbox-filter-0w74j current filter code:
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
I've actually followed #2047 @vsSanti way, and implemented multiselect.
() => ({
[...]
multiSelect: (rows, id, filterValues) => {
if (filterValues.length === 0) return rows;
return rows.filter((r) => filterValues.includes(r.values[id]));
},
[...]
}),
[]
);
|
Beta Was this translation helpful? Give feedback.
-
Hi, just came across your implementation and I am working on something similar. I was wondering if you could explain how checkbox and options (for the filtering) are displayed with respect to the code and how would you modify the options if you had to? Thanks! |
Beta Was this translation helpful? Give feedback.
I've actually followed #2047 @vsSanti way, and implemented multiselect.