DO NOT MERGE Temporary DataTable example of multi select across pagination #7173
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a DataTable example that uses pagination of data that is only partial (ie as if it only grabs a page at a time of data from the backend) and allows selection across pages and the items are selected by default.
To do this in a scalable way you instead need to track what items get deselected. This also means that at the time you want to submit this result to a backend API, the API needs to support being told what items you don't want selected.
To avoid this you would need a reasonable api to get the entire list of primary keys for the selected items which isn't scalable.
Note the select/deselect all checkbox in the header of Grommet DataTable component won't be able to support this across pagination without the entire data set. So if you go this route you'd likely have to disable that checkbox via
allowSelectAll={false}