T
TanStack3y ago
equal-aqua

How can I access data without column?

I made simple example to help you understand my situation. There are 3 properties in data.
{
id: string,
min: number,
max: number,
}
{
id: string,
min: number,
max: number,
}
And I want to show 2 columns:
["id", "percent"]
["id", "percent"]
It might be simple, but I couldn't find a way to implement it with 2 columns. If I register min and max to columns, it works fine but is it the best way?
const columns = [
helper.accessor("id",{}),
helper.accessor("min",{}),
helper.accessor("max",{}),
helper.display({
id:"percent",
header:"percent",
cell: (ctx)=>ctx.row.getValue("min") / ctx.row.getValue("max") * 100
})
]
const columns = [
helper.accessor("id",{}),
helper.accessor("min",{}),
helper.accessor("max",{}),
helper.display({
id:"percent",
header:"percent",
cell: (ctx)=>ctx.row.getValue("min") / ctx.row.getValue("max") * 100
})
]
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?