Open alexcjohnson opened 5 years ago
Had same issue as we are refreshing the datatable based on user selecting another value from a dropdown. We just return the selected_rows = [] as part of the datatable callback that refreshes the table, which is working as expected. Please do let us know if there is a more elegant way to reset the selected rows on datatable refresh.
Expandable rows would be super useful. Do you see any viable paths for implementing this?
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 aselected_rows_timestamp
or something, and output bothdata
andselected_rows
.The more obvious way to work around it would be to use
selected_row_ids
. However,selected_rows
andselected_row_ids
don't update correctly when we changedata
- related to https://github.com/plotly/dash-table/issues/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 useselected_row_ids
as the source of truth and updateselected_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 foractive_cell
and related props,row
andcolumn
must be used to write these props,row_id
andcolumn_id
are ignored (and you get an ugly error "Cannot read property 'NaN' of undefined" if you don't providerow
andcolumn
)