react-data-table-component
react-data-table-component copied to clipboard
[FEATURE]: Support additional row selection capabilities
Feature Check list
- [X] Agree to the Code of Conduct
- [X] Read the README to ensure the feature is not already present
- [X] You read Creating Issues, Features and Pull Requests
- [X] Considered the value versus complexity for all users of the library as well as library maintenance
- [X] Considered if this can be a storybook or documentation example
Is your feature request related to a problem? Please describe
NA
Describe the solution you'd like
A user has the ability to select a row (not using the checkbox) to be able to perform some operation on the selected data. A SHIFT+click to select multiple or CTRL+click to toggle select individual rows (again, different from a checkbox select).
Describe alternatives you've considered
I tried to keep track of the last row selected (when clicking on the checkbox) and the new row selected (using the checkbox), but I have no way to determine any rows between the 2 items due to possible sorting of the data in the table. This means that just knowing the start/end index of my selections are not sufficient once sorting is involved.
Additional context
I starting thinking that in my app, I would keep a new state of "Selected" that is different from checked, and then I could know what rows are "selected". However, getting these selected rows seems to need to be supported within the component as I cannot "reverse engineer" my selection based on using data passed back from onSelectedRowsChange.