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 am not getting few field (cells) values on Table UI after displaying 13 rows ,getting undefined ,i am using nextjs 14+ "@tanstack/react-table": "^8.9.3",
#5203
}
in Table UI only the first 13 rows have correct values of the "status" field but after 13 , the status or row.original is coming undefined
i am not able to figure out where the issue is coming, data is coming properly from the server and also checked data that I passed to the table comp.
in column ,row.originial value coming undefined after 13 rows (first 13 rows data coming correct and after coming undefined )
(rest of the data displaying properly accept
"status " column data)
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
Uh oh!
There was an error while loading. Please reload this page.
-
-i am passing data like
{myTable?.data? (
and column i have defined like
export const columns: ColumnDef[] = [
{
id: "select",
cell: ({ row }) => {
const data = row.getAllCells();
const status = data[row.index]?.row?.original?.status;
return (
<Checkbox
checked={row.getIsSelected()}
onCheckedChange={(value) => {
row.toggleSelected(!!value);
}}
disabled={status === "FAILED" ? true : false}
/>
);
},
enableSorting: false,
enableHiding: false,
},
.....
....
{
header: "Status",
cell: ({ row }) => {
const data = row.getAllCells();
return (
<Button variant={"outline"}>
{data[row.index]?.row?.original?.status === "FAILED"
? " TX FAILED"
: data[row.index]?.row?.original?.status ?? SELL_DEFAULT}
);
},
accessorKey: "status",
},
and
export function MyTableDataTable<TData, TValue>({
columns,
data,
}: DataTableProps<TData, TValue>) {
....
...
const table = useReactTable({
data,
columns,
getCoreRowModel: getCoreRowModel(),
getPaginationRowModel: getPaginationRowModel(),
getSortedRowModel: getSortedRowModel(),
getFilteredRowModel: getFilteredRowModel(),
onGlobalFilterChange: setGlobalFilter,
});
....
..
//table body
{table.getRowModel().rows?.length ? (
table.getRowModel().rows.map((row) => (
{row.getVisibleCells().map((cell) => (
{flexRender(
cell.column.columnDef.cell,
cell.getContext()
)}
))}
}
in Table UI only the first 13 rows have correct values of the "status" field but after 13 , the status or row.original is coming undefined
i am not able to figure out where the issue is coming, data is coming properly from the server and also checked data that I passed to the table comp.
in column ,row.originial value coming undefined after 13 rows (first 13 rows data coming correct and after coming undefined )
(rest of the data displaying properly accept
"status " column data)
Beta Was this translation helpful? Give feedback.
All reactions