Is there a way to access two field using columnHelper.accessor
?
#4388
Answered
by
writes-of-spring
bryanprimus
asked this question in
Q&A
-
I want to access two fields with something like this type Data {
senderName: string
senderId: string
}
const columnHelper = createColumnHelper<Data>()
columnHelper.accessor(["senderName", "senderId"], {
header: "Sender Details",
cell: info => `${info.getValue().senderName} ${info.getValue().senderId}`,
size: 180,
}), or is there any workaround? |
Beta Was this translation helpful? Give feedback.
Answered by
writes-of-spring
Sep 16, 2022
Replies: 1 comment 5 replies
-
The first argument of the accessor can be a string, or a callback function using the row data
|
Beta Was this translation helpful? Give feedback.
5 replies
Answer selected by
bryanprimus
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The first argument of the accessor can be a string, or a callback function using the row data
https://tanstack.com/table/v8/docs/guide/column-defs#accessor-functions