Access row data not defined by column
I am very new to TanStack Table -- sorry if this is a noob question...
I have row data that contains stats about files:
I would like to display a little icon next to the filename based on its type:
However, this does not work because it cannot find a row with
columnId = "type". Adding a new column with accessorKey: "type" solves the issue. However, I do not want to create a column for just type, because I only want to use this value to add an icon near my filename. I have tried to create a column that is always hidden, but there does not seem to be an option to do this with ColumnDef.
How do I access data that exists in the row data, but that is not used by a ColumnDef?1 Reply
adverse-sapphireOP•2y ago
Nevermind, I worked it out in the end. I did not know there was an
original field on the row object that lets me access the underlying data.
My apologies!