gregnb / gregnb/mui-datatables
Server side data with selected rows
- Dominant language
- JavaScript
- Stars
- 2.7k
- Forks
- 906
- PR merge metrics
- No merged PRs in 30d
Description
## Expected Behavior
If you are doing a sever side render with selected rows and have `selectToolbarPlacement` set to 'above' when you do something like search, filter or sort the selected rows should be unselected as that Item might not be in the response. Might want to update the `onTableChange` to have set state options so user can reset table state of thing if needed.
## Current Behavior
If you are doing a sever side render with selected rows and have `selectToolbarPlacement` set to 'above' when you do something like search, filter or sort the selected rows index is still selected. So if I select the first item an sort by name the first item of the few results is still selected .
## Steps to Reproduce (for bugs)
1. set `serverSide: true`
2. set `selectToolbarPlacement: 'above'`
3. select a first row
4. sort by column header
https://user-images.githubusercontent.com/1731744/148418713-634ee97d-77be-49aa-8f99-7f28f738625f.mp4
## Your Environment
| Tech | Version |
|--------------|---------|
| Material-UI | ^5.1.0 |
| MUI-datatables | ^4.0.0 |
| React | ^17.0.2 |
| browser | all |
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reproducing the issue with serverSide enabled, selectToolbarPlacement set to 'above', and a selected row, then trigger sorting, searching, or filtering. Trace the table selection state and onTableChange handling; done means rows no longer remain selected when the server response may contain different items.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, react
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100