T
TanStack3w ago
correct-apricot

Extending ColumnDef<T> to include extra data

I'd like to be able to extend ColumnDef to allow my wrapper to essentially provide a dataType property, that I can use in my default column renderer, so I could concievably do something like
const columns:SomeColumnDef<T>[] = [
{
//...
dataType: 'date'
}];
const columns:SomeColumnDef<T>[] = [
{
//...
dataType: 'date'
}];
and then render the date a specific way, or have a dataType of 'progress' where we would render a progress bar. I think I can handle the dynamic decision of what to render and how to render it, but wondering if I can attach that extra meta when defining columns for the table, and access that meta during the cell function property of the defaultColumn.
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?