Select all table rows with server side pagination
I have table that displays data that comes from an api using server side pagination. How do I mark all rows as selected when the user checks the 'select all' checkbox in header? Because currently, when the user clicks select all, the rows of the entire page are selected, but not from the entire table.
I'm using react-table v7.
Checkbox column:
Table config:
I'm using react-table v7.
Checkbox column:
{
id: "selection",
Header: ({
getToggleAllRowsSelectedProps,
}) => {
return <IndeterminateCheckbox
{...getToggleAllRowsSelectedProps()}
/>
},
Cell: ({ row, selectedFlatRows }) => {
return (
<IndeterminateCheckbox {...row.getToggleRowSelectedProps()} />
) },
}Table config:
{
columns: memoizedColumns,
data:[],
initialState: {},
manualPagination:true,
manualSortBy: true,
manualGlobalFilter: true,
manualFilters: true,
pageCount,
autoResetSelectedRows: false,
getRowId(originalRow, relativeIndex, parent) {
return originalRow.id;
},
}