ui
ui copied to clipboard
Data table row selection, totally breaks when selecting a row
I followed the component example and it freezes the entire page once i click on one of the select icons.
const table = useReactTable({
data: dataWithToken,
columns: columns,
onSortingChange: setSorting,
onColumnFiltersChange: setColumnFilters,
getCoreRowModel: getCoreRowModel(),
getPaginationRowModel: getPaginationRowModel(),
getSortedRowModel: getSortedRowModel(),
getFilteredRowModel: getFilteredRowModel(),
onColumnVisibilityChange: setColumnVisibility,
onRowSelectionChange: setRowSelection,
enableRowSelection: true,
enableMultiRowSelection: true,
state: {
sorting,
columnFilters,
columnVisibility,
rowSelection,
},
});
```
```
{
id: "select",
header: ({ table }) => (
<Checkbox
checked={table.getIsAllPageRowsSelected()}
onCheckedChange={(value) => table.toggleAllPageRowsSelected(!!value)}
aria-label="Select all"
/>
),
cell: ({ row }) => (
<Checkbox
checked={row.getIsSelected()}
onCheckedChange={(value) => row.toggleSelected(!!value)}
aria-label="Select row"
/>
),
enableSorting: false,
enableHiding: false,
},
```
Same error
unable to reproduce. please provide more context
Using id: "select"
for column doesn't work at all for me. The column doesn't even appear. I have to rename my column to smth else, i.e. "selection".
I had a problem with Checkbox column not appearing, and the problem was that I imported { Checkbox } from radix-ui, instead of @/components/ui. Hope it will help someone
This issue has been automatically closed because it received no activity for a while. If you think it was closed by accident, please leave a comment. Thank you.
Has anyone solved this error yet? Help!!!
Perhaps the problem is due to infinite re-rendering of your table when any change is made to your table's state. This can be resolved by wrapping your data
and column
within the useMemo
hook.
Check here for more info.
I had a problem with Checkbox column not appearing, and the problem was that I imported { Checkbox } from radix-ui, instead of @/components/ui. Hope it will help someone
Omg, this is what happened to me... X_X
https://www.instagram.com/1900_officelle?igsh=MW5ueDI0b21qbW44Zg==
TonnyMunkNielsen @.***> schrieb am Mo., 5. Aug. 2024, 01:30:
I had a problem with Checkbox column not appearing, and the problem was that I imported { Checkbox } from radix-ui, instead of @/components/ui. Hope it will help someone
Omg, this is what happened to me... X_X
— Reply to this email directly, view it on GitHub https://github.com/shadcn-ui/ui/issues/1960#issuecomment-2267924548, or unsubscribe https://github.com/notifications/unsubscribe-auth/BIO77CJOJBORUGV7EJCRXI3ZP22P3AVCNFSM6AAAAAA7OQ6ZW2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENRXHEZDINJUHA . You are receiving this because you are subscribed to this thread.Message ID: @.***>