Strategy for data / selected_rows / selected_row_ids #479
Description
While investigating a community post about expandable rows I suggested a callback changing data based on selected rows - unfortunately this has problems: if you just use selected_rows
, then selecting an earlier row will mean the index of a later selected row changes. We could, I suppose, work around this if we had a selected_rows_timestamp
or something, and output both data
and selected_rows
.
The more obvious way to work around it would be to use selected_row_ids
. However, selected_rows
and selected_row_ids
don't update correctly when we change data
- related to #239 but it's tougher here as there isn't necessarily any link between prior and new rows. We could make such a link if the user has provided row IDs - in which case it would make sense to use selected_row_ids
as the source of truth and update selected_rows
to match.
Related: currently selected_row_ids
is read-only; writing to it doesn't error but doesn't update the displayed table either. Would be nice if it could at least optionally be writable. Similarly for active_cell
and related props, row
and column
must be used to write these props, row_id
and column_id
are ignored (and you get an ugly error "Cannot read property 'NaN' of undefined" if you don't provide row
and column
)