Replies: 2 comments 5 replies
-
Yeah getSelectedRowModel is only going to be able to filter based on the client side data you are passing it. So it doesn't really help much if using server side pagination. The selected row IDs are in the row selection state for you to use as you pointed out though. |
Beta Was this translation helpful? Give feedback.
5 replies
-
Any success in achieving this? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm currently trying to build a table, using data from an external API (using Tanstack Query/
useQuery
).I can render everything fine, and have setup manual pagination (similar to this pagination-controlled example), and am attempting to get Row Selection working. I am 90% of the way there, but struggling with getting the data to persist between pagination.
On clicking next page in the pagination, the table returns the correct data, but seems to forget saved/selected rows from the previous page.
When I try to use
table.getSelectedRowModel()
- everything is empty. However, if I go back a page, all that data is available when callingtable.getSelectedRowModel()
.It's like each page is counting as it's own
table.getSelectedRowModel()
, rather than combining together into one.Alternatively, I have got a
useState
setup, which is storing the row ID into therowSelection
array/state ononRowSelectionChange
(lifted from here) This is persisting, but isn't much use to me as it's just IDs.If there's no way to fix the
table.getSelectedRowModel()
, is there a way to get the row data from thatrowSelection
ids somehow?Hope someone can help, thanks!
Beta Was this translation helpful? Give feedback.
All reactions