Replies: 3 comments 3 replies
-
hey @MAST1999 did you ended-up finding a good solution for this? |
Beta Was this translation helpful? Give feedback.
-
It's actually pretty easy, i found it this way : |
Beta Was this translation helpful? Give feedback.
-
I actually found a workaround for this. Make sure you have global filters configuration working. You can just disable the const requiredData = useMemo(() => {
if (columnFilters.length) {
return data.filter((item) =>
columnFilters.every((filter) =>
(item[filter.id as keyof TData] as string).includes(
filter.value as string
)
)
)
}
return data
}, [columnFilters, data]) Then you can assign this to your data in the
by doing this it will work for global filter as required and for your text based column filters as well. Hope this helps. |
Beta Was this translation helpful? Give feedback.
-
Hi
It would be great if there were a way to get row data that is filtered only by column filters (without the global filters applied) and get a row model with only global filters applied.
My use case is like this. I built a table using
@tanstack/react-table
and it works excellently with filtering and sorting. Then I needed to build a chart that would use the filtered data from the table to draw. It only wanted data filtered by the column filters. Then I needed some cards which showed the data only filtered by the global filter. I looked through all the APIs for thetable
but couldn't find anything that would enable this.It would be great if we had
getFilteredByColumnFilter
andgetFilteredByGlobalFilter
so that we could use those Data however we need to.I think this is a bit niche but if it is accepted I can work on the PR myself as I've already done it (albeit kind of ugly) for our use case.
Beta Was this translation helpful? Give feedback.
All reactions