T
TanStack3mo ago
adverse-sapphire

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 Error: getRow could not find row with ID: row-2 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?
2 Replies
adverse-sapphire
adverse-sapphireOP3mo ago
here, an example where row pinning is effected by sort and filter - server side: sort and filter - NOK - client side: pagination - OK https://codesandbox.io/p/devbox/elastic-black-tv7w7r?workspaceId=ws_GBfUhJiP97CY9htixGRZPi
adverse-sapphire
adverse-sapphireOP3mo ago
DEMO

Did you find this page helpful?