T
TanStack7mo ago
rival-black

How to filter row on cell type of Array (renders as string)?

I have filtering working for any columnId that is a string.
export type ProjectItem = {
title: string
tools: string[],
startDate: string,
endDate: string
}
export type ProjectItem = {
title: string
tools: string[],
startDate: string,
endDate: string
}
I set table.getColumn(filterColumnId)?.setFilterValue(event.target.value) and my table rows filter as expected. However, if my column type is actually an Array of strings, even though my cell renders a joined string, the filter logic doesn't seem to be able to handle that data type. What do I need to do so that the filter logic uses the rendered cell value (string) and not the typescript type in the column definition (array)?
1 Reply
rival-black
rival-blackOP7mo ago
Nevermind the above I just transformed my array into a string before integrating with TanStack table

Did you find this page helpful?