-
-
Notifications
You must be signed in to change notification settings - Fork 416
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multi-page Row Selection: Persist selected rows across pages when using serverPagination #524
Comments
Upon further inspection this would also require changing the following react-data-table-component/src/DataTable/DataTable.js Lines 159 to 167 in f7b55ab
|
This is the exact default behavior when client-side paging - that is, that selects are persisted. Are you using On a related note, I have a PR that I am working on that may or may not impact this. The feature is to allow only rows to be selected on visible rows. |
@jbetancur Yes, this is specifically for when As for #520, based on the request description in #518 that should only modify the behavior of the Select All feature, right? That shouldn't interfere with this feature unless I'm missing something. It's not as if that prevents the selection of elements from other pages, only that it adds an extra step required on the part of the user to do so... From the description:
|
Thanks |
Feature Check list
Is your feature request related to a problem? Please describe
Apparent inability to implement multi-page selection using this table.
Please let me know if I'm missing something obvious.
Describe the solution you'd like
A new prop for the Data Table that prevents clearing of selected rows when the page or sort is changed when using
serverPagination
. Possibly a prop for each of them. This prop would be optional with the default being false so existing programs are not modified.These two cases in the reducer would be changed in the following way:
Note the addition of
selectedRowsPersist
Alternative prop names:
persistSelectedRowsOnPageChange
&persistSelectedRowsOnSortChange
Describe alternatives you've considered
Supplying more information via the
onSelectedRowsChange
method that provides information required to implement multi-page selection in the user space. (More work than proposed solution as far as I can tell)Storing the selections outside this component and updating those selections when
onSelectedRowsChange
. The problem here is thatonSelectedRowsChange
returns the empty list of selections when pagination occurs, which fires prior toonChangePage
, making it (seemingly) impossible to tell if the selections were cleared by the user intentionally or if it was due to the page changing. (Not viable)Additional context
The text was updated successfully, but these errors were encountered: