T
TanStack3y ago
fair-rose

Paginated table with Remix

So i'm building a table in a Remix application with a select all checkbox, a checkbox per row, & pagination. I just noticed that when I try and select all on a table with 100 rows (in pages of 15), it selects all the rows as expected. But only submits the 15 that a rendered. Any ideas as to how to send all the rows?
1 Reply
correct-apricot
correct-apricot3y ago
the browser will only know about the one page that's currently rendered, so it'll only submit what it knows about. you could add a flag to your api call that indicates that clicking 'submit' is going to send what the user sees and what the user doesn't see. Consider adding an indicator on the page that the user is going to take an action on rows that they don't see! You'll need a server-side-only handler that recognizes the flag and does the appropriate handling for 'all rows'

Did you find this page helpful?