Editable table: edit two columns and update calculations in third to reflect changes

I think that my problem is very similar to the question here which was solved under dash_table_experiments. Chriddyp posted what looks like an update for dash_table, but I cannot get it to work. Can a kind soul help? I’m new to dash/html and have been stuck on this for more than a week!



we have an example in the dash table user guide that uses one column to update another column. see https://dash.plot.ly/datatable


Presumably ‘Updating Columns of the Same Table’ example from here(https://dash.plot.ly/datatable/editable). Currently trying to get that to work in conjunction with the reference(https://dash.plot.ly/datatable/reference). And finally making progress! I have the basic mechanics of my table working now.

However, I am still stuck on one aspect: the example is initialized with data within the html, and then the table updates based on user input. But my situation is different: I populate my data-table from a local data-frame (sub-df) constructed based on the value selected from a drop-down. I need some way of being able to re-initialize the table, doing relevant calculations on that data, when a new value (and sub-df) is selected, and then reverting to taking data from the table once that initialization has happened. It struck me that one approach might involve a flag that is set to 1 in the dropdown callback so that every time a new value/sub-df is selected, the table re-initializes in the second callback. During that re-initialization, the flag would be set back to zero so that the next time the callback is triggered, edited data from the table is read instead. But in order to do that, one needs the ability to set an intermediate value (the flag) in the first callback, and also in the second callback, i.e. the flag has to be an input and output to two callbacks which is not allowed. So there must be some other way of doing this that I’ve not yet figured out …