-
Hey all, I'm trying to determine if a column has a custom cell render defined. For instance, in the code below, I want to know that The goal here is to determine
What I'd like to do is something akin to:
Note: The above is dummy code so forgive any little nits. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
@mcongrove There is a way to accomplish this but it is a tad bit error prone: Option 1: You can store data, such as a boolean, in table/packages/table-core/src/types.ts Line 202 in c5cf4e7 Option 2: That said, I think a huge opportunity for improvement exists by having |
Beta Was this translation helpful? Give feedback.
@mcongrove There is a way to accomplish this but it is a tad bit error prone:
Option 1: You can store data, such as a boolean, in
ColumnDef.meta
, but now you need to ensuremeta
accurately reflects thecell
render, which could lead to bugs:table/packages/table-core/src/types.ts
Line 202 in c5cf4e7
Option 2:
If instead your
ColumnDef.cell
could control theclassName
styling, then you can also store inColumnDef.meta
(if fixed) or (if dynamic/changes between renders) even just define a function/Dictionary,Int => Object
, that takes aColumn
id
and outputs additional customContext
based on the column id to render. Then, yourColumnDef.cell
…