You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using pagination on Mantine MRT table, with data being remotely fetched. The table is working fine and its displaying data correctly with pagination.
Now, I am trying to add row selection and some action buttons.
The issue is selected rows(using table.getSelectedRowModel()) are correctly fetched only for current page.
For example: If I select 2 rows from page 1, go to page 2 and select another row. table.getSelectedRowModel() is only returning record for current page(Page 2).
Use table.getSelectedRowModel() to get all selected rows(in my case on button click)
Expected Behaviour: 2 Selected rows from both pages should be returned
Actual Behaviour: Only selected row of current page is returned
Bug 2:
6. Click on "Clear selection"
Screenshots or Videos (Optional)
No response
Do you intend to try to help solve this bug with your own PR?
None
Terms
I understand that if my bug cannot be reliably reproduced in a debuggable environment, it will probably not be fixed and this issue may even be closed.
The text was updated successfully, but these errors were encountered:
I am seeing the same, but without remote fetching/pagination
@thenick775-TST Can you please post an issue with your case? Because in the case of OP, with remote pagination, this is expected behaviour. But with uncontrolled pagination, we should take a look into it.
@wizard22-cc OP This is expected behaviour for manual pagination. The selection is being lost simply because the rows you selected are not in memory, as you changed pages. If you want to keep the selection between pages, you need to handle the selection state manually.
@alessandrojcm I misinterpreted how this was supposed to function, I was doing a combination of client side manual filtering of the data (mimicking remote filtering , along with client side filtering in the table).
I realized a bit too late I needed to do either one or the other, or manage all filtering myself
mantine-react-table version
2.0.0-beta.7
react & react-dom versions
18.3.1
Describe the bug and the steps to reproduce it
I am using pagination on Mantine MRT table, with data being remotely fetched. The table is working fine and its displaying data correctly with pagination.
Now, I am trying to add row selection and some action buttons.
The issue is selected rows(using
table.getSelectedRowModel()
) are correctly fetched only for current page.For example: If I select 2 rows from page 1, go to page 2 and select another row.
table.getSelectedRowModel()
is only returning record for current page(Page 2).Same issue happens when you click on "clear selection", it only clears selection of current page.
The issue also exists in MRT's official example:
https://v2.mantine-react-table.com/docs/examples/remote
Below is my table config:
Steps:
Bug 1:
table.getSelectedRowModel()
to get all selected rows(in my case on button click)Expected Behaviour: 2 Selected rows from both pages should be returned
Actual Behaviour: Only selected row of current page is returned
Bug 2:
6. Click on "Clear selection"
Expected Behaviour: All selections from all pages should be cleared
Actual Behaviour: Only selections of current page is cleared
Minimal, Reproducible Example - (Optional, but Recommended)
Steps:
Bug 1:
table.getSelectedRowModel()
to get all selected rows(in my case on button click)Expected Behaviour: 2 Selected rows from both pages should be returned
Actual Behaviour: Only selected row of current page is returned
Bug 2:
6. Click on "Clear selection"
Screenshots or Videos (Optional)
No response
Do you intend to try to help solve this bug with your own PR?
None
Terms
The text was updated successfully, but these errors were encountered: