jbetancur / react-data-table-component

A responsive table library with built-in sorting, pagination, selection, expandable rows, and customizable styling.
https://react-data-table-component.netlify.app
Apache License 2.0
2.03k stars 409 forks source link

[FEATURE]: Support additional row selection capabilities #1211

Open ZenHarbinger opened 6 months ago

ZenHarbinger commented 6 months ago

Feature Check list

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.