T
TanStack6mo ago
conscious-sapphire

Accessing column meta from filterFn

I need to access a particular function passed in via column meta, to sanitize the value being filtered.
export function multiOptionFilterFn<TData>(
row: Row<TData>,
columnId: string,
filterValue: FilterValue<'multiOption'>,
) {
const value = row.getValue<string[]>(columnId)

// Sanitize the value here, before continuing
// TODO

return __multiOptionFilterFn(value, filterValue)
}
export function multiOptionFilterFn<TData>(
row: Row<TData>,
columnId: string,
filterValue: FilterValue<'multiOption'>,
) {
const value = row.getValue<string[]>(columnId)

// Sanitize the value here, before continuing
// TODO

return __multiOptionFilterFn(value, filterValue)
}
There doesn't appear to be a way to access the table or column from inside a filter function. Any known workarounds or solutions?
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?