Currently, it's difficult to process actions on a range of selected rows, since we don't have access in the selection data to which row indexes are selected, we can only see the data in the rows, and the last selected row index.
It would be useful to add a props.selection.selectedRows
as a list which contains the row indexes selected.
For example, I want users to be able to select a bunch of rows and use a button to move the data in those rows to somewhere else and then remove those rows from the table. Removing the rows is hard!
Current thinking is that I will add the props.selection.selectedRow
value into a custom.selectedRows
list on row click, and keep the list the length of the props.selection.data
list length using FIFO. Certainly not very nice
E.g.
# on rowClick
def runAction(self, event):
selectedRow = event.rowIndex
selectionLength = len(self.props.selection.data)
selectedRows = self.custom.selectedRows
selectedRows.append(selectedRow)
selectedRows = selectedRows[-1*selectionLength:]
self.custom.selectedRows = selectedRows