Skip to content Skip to sidebar Skip to footer

Dash Plotly - Create A Dropdown Menu Dynamically, Selection Of Multiple Rows, Table Export?

I have a data set that looks like this: cat_id author year publisher country value (dollars) name1 kunga 1998 D and D Australia 10 name2 siba 2001 D and D U

Solution 1:

  1. What you would probably want to do here is create a callback for each dropdown (or a multi-output callback for all of them) that outputs to the options prop. Maybe triggered by updates to the table. You can initialize the dropdowns in the layout with a dummy dropdown option to start, and let the callback take it from there.

  2. I'm not sure whether the table does that on its own, but you could make your callback for the table do this. Because you can only have one callback per unique output, anything that involves updating the table's data prop would have to be run under the seam callback. You could probably add a button like "delete rows" to listen for as Input, and use the data and selected rows as State. When that button is clicked and fires the callback, you simply rebuild the dataframe for the table without rows in the rows_selected value, and then output to the table's data again.

  3. Sure. Export it how? You could set up a callback from a button, "export data" which could export it however you want. You could have the function dump the data to a file, or print it to the console, save it in a database, email it, or whatever you want basically. Anything you could do with Python really. The callback would need an output, so maybe just open a dialog or a snackbar letting the user know that the export request was received and started/completed.

Post a Comment for "Dash Plotly - Create A Dropdown Menu Dynamically, Selection Of Multiple Rows, Table Export?"