Keep row pinning in place + sort on server side
Hello,
My data is sorted correctly on the server, and the sorting displays properly in the table. However, I’m having trouble figuring out how to keep the pinned row visible when using server-side (manual) sorting. Pinned rows work as expected with client-side sorting. Current behaviour is that on sorting the pinned row is affected
keepPinnedRows: true,
manualSorting: true,
enableSorting: true,
...
const rows = setRowPinning ? table.getCenterRows() : table.getRowModel().rows;
also, I do get
so to resolve it I found one solution but I don't see how to fix it in another way, I do
export const getPinnedRows = (table: TableType) => {
try {
return {
topRows: table.getTopRows(),
bottomRows: table.getBottomRows(),
};
} catch {
return { topRows: [], bottomRows: [] };
}
};
getRowId={(row) => row.id} didn't help, for sure there is unique id in data
Could you provide an example or code snippet demonstrating how to use manualSorting, manualFiltering, or manualPagination while keeping a pinned row visible with keepPinnedRows?
My data is sorted correctly on the server, and the sorting displays properly in the table. However, I’m having trouble figuring out how to keep the pinned row visible when using server-side (manual) sorting. Pinned rows work as expected with client-side sorting. Current behaviour is that on sorting the pinned row is affected
keepPinnedRows: true,
manualSorting: true,
enableSorting: true,
...
const rows = setRowPinning ? table.getCenterRows() : table.getRowModel().rows;
also, I do get
Error: getRow could not find row with ID: row-2so to resolve it I found one solution but I don't see how to fix it in another way, I do
export const getPinnedRows = (table: TableType) => {
try {
return {
topRows: table.getTopRows(),
bottomRows: table.getBottomRows(),
};
} catch {
return { topRows: [], bottomRows: [] };
}
};
getRowId={(row) => row.id} didn't help, for sure there is unique id in data
Could you provide an example or code snippet demonstrating how to use manualSorting, manualFiltering, or manualPagination while keeping a pinned row visible with keepPinnedRows?