Replies: 1 comment
-
Ok I worked out a simple solution using manual pagination on client side (not server pagination) to achieve the goal, ie pump in dynamitic data to table as data source based on pagination state, here is code to share https://codesandbox.io/p/sandbox/react-environment-forked-225wm3?file=%2Fsrc%2FPaginationTest.js%3A70%2C41 |
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
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
user case:
I load a react page with MRT table data from backend (without pagination) and no need to use manual (server) pagination, everything working fine.
Some data in my table has link when user click it opens (navigate) another page with state data piped to the new page (table data including pagination index and size).
On this new page when user click back button the UI would reload the previous table page data (I use redux useSelector hook) with same data and same pagination (index and size).
when reload the page I need to reset the pagination (cashed when load new page with link) state.
I don't want load page with initial pagination instead I need to reset current table pagination (index) to cashed index,
(for example, before navigate to new page I was in page3, ie pageIndex=2, and when navigate back I should in page 3, not page1 for the table in pagination)
in this case I need use some table pagination (build in or manual) API to reset pagination state and trigger page refresh with new index/size but seems MRT do not provide this feature.
In my impression there is only 2 options: Opt 1 use build in pagination ie MRT will auto handle state and etc. or Opt2 use manual for state controlled pagination.
From MRT pagination doco it has only one example using manual pagination for backend (server) pagination. it'll be great to have example using manual pagination on client side.
David
Beta Was this translation helpful? Give feedback.
All reactions