You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like to be able to access the table meta object from accessor functions.
My reasoning is outlined below. If I am misunderstanding anything I'd be happy to be corrected.
Table meta is the recommended way to make a 'thing' available everywhere in the table (e.g. a locale utilities object is mentioned in the docs)
The return value from a column accessor function is used for operations like filtering and sorting
Using the locale object as an example, if I intend to pipe the cell value through a formatter retrieved from table.meta, I'd like that to happen in the accessor function (not the cell renderer) so that sorting and filtering are guaranteed to behave predictably for the user.
Aside: my initial scan through the docs led me to believe that I could maybe do something like row.getAllCells()[0]?.getContext().table.options.meta, (which would be kinda nasty even if it worked). However, when testing I realised that the row object passed to the accessor function is of type TData, not Row. In hindsight it looks like I misread these docs. Maybe it's worth either clarifying the AccessorFn signature and/or adjusting the code snippets there to read rowData instead of just row?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'd like to be able to access the table meta object from accessor functions.
My reasoning is outlined below. If I am misunderstanding anything I'd be happy to be corrected.
accessor
function is used for operations like filtering and sortingAside: my initial scan through the docs led me to believe that I could maybe do something like
row.getAllCells()[0]?.getContext().table.options.meta
, (which would be kinda nasty even if it worked). However, when testing I realised that therow
object passed to the accessor function is of typeTData
, notRow
. In hindsight it looks like I misread these docs. Maybe it's worth either clarifying theAccessorFn
signature and/or adjusting the code snippets there to readrowData
instead of justrow
?Beta Was this translation helpful? Give feedback.
All reactions