I want to be able to click on a row with multiple values in one column, and for the table to expand and give each value its own row, but I’m not sure if this can be done smoothy in Dash and how.
For example
original table:

and when you click row with ID 1:

I’ll be happy for any tips and suggestions!
1 Like
Interesting idea @rovingrhea! I think you can do this by making data
a callback output depending on selected_row_ids
. Having said that though, we have two props, selected_rows
and selected_row_ids
and I suspect they’ll behave in weird ways if you insert new rows before an already selected row. For your use case it would be best to have selected_row_ids
be the authority, and selected_rows
be calculated from that and data
. I haven’t tested it but I suspect right now we do the opposite, since selected_rows
is the older property.
Perhaps have a multi-output callback returning data
and selected_rows
based on selected_row_ids
- though in that case I’d be worried about infinite loops. We’ll have to investigate this a little…
Hmm, I went down a bit of a rabbit hole trying to get this to work, and I’m afraid I don’t have a good solution right now. Curious if anyone else has ideas about it, or you can follow the issue I made to discuss potential enhancements to the table component https://github.com/plotly/dash-table/issues/479