T
TanStack7mo ago
extended-salmon

Row Selection is not persisting between pages

Following in the object i am passing to useReactTable const table = useReactTable({ data, columns, pageCount: pageCount, enableSortingRemoval: false, state: { pagination: paginationState, columnVisibility, sorting, columnFilters, }, onPaginationChange: handlePaginationChange, getFilteredRowModel: getFilteredRowModel(), getCoreRowModel: getCoreRowModel(), onColumnFiltersChange: setColumnFilters, getSortedRowModel: getSortedRowModel(), getPaginationRowModel: getPaginationRowModel(), onSortingChange: setSorting, manualPagination: true, manualSorting: false, }); The problem is when i am changing the page number or page limit the selected rows don't persist . Selected rows are lost. What is the solution for that? One thing i would like to mention is that the data is coming from server component and i am getting the page and limit from the query params.
2 Replies
extended-salmon
extended-salmonOP7mo ago
@KevinVandy Can you guide me a liitle about this?
absent-sapphire
absent-sapphire7mo ago
Only the rowSelection state persists when using manualPagination. The selected rows are derived from rows and rowSelection state. If the rows don't exist in the table, they won't exist as selected rows

Did you find this page helpful?