I’m wondering, whether it’s possible to have an optional Input to callback. I have a code like this:
@app.callback( [ Output("url", "pathname"), Output("hidden_div_for_drillthrough_store", "data"), ], [ Input("specialism-overview-table", "active_cell"), #Input("activities-overview-poorters-table", "active_cell") # TODO ok, cant add, as they never exist together ], [State("specialism-overview-table", "data")], ) def drill_to_specialism_view(active_cell, table_data): ....
This callback is used to drillthrough to a different page. At the moment, only single input is available, which is a dash_table.DataTable.active_cell event from table “A”. This work without any issues.
As i have a multiple page app, i would like to add multiple inputs to this callback, each taking the same event, but from different tables (“B”, “C” etc.).
These tables are created dynamically on every separate page, therefore there is no possibility, that there are multiple tables shown at any given time. Hoverver, i cant define the callback to take multiple Inputs, due to missing property ID (which is kinda obvious, as only single table exists at any given time.)
So the question is, whether it’s possible to define an optional Input to callback?
Or somehow dynamically define a callback Input based on possible property IDs?
Thank in advance for any suggestions.