First of all a big thanks to everyone at Plotly and the community for an excellent product and information/resources available!
I am working on an app that takes a list of system and their names and lists these as āblocksā in a grid. When a āblockā is clicked some actions (filtering of a table, communicating with an API, etc.) should be executed through a callback with other_info
. Initially, I tried to implement this based on the āEventā-functionality, but as this has been removed I am now working with āInputā.
Currently, I am experiencing two challenges:
1. The dynamically defined callback appears to pass one variable per āblockā to the function to be executed (i.e. way more inputs than the function is expecting). As the āblocksā are dynamically defined it is no possible to āhard codeā these as inputs to the function.
2. Using n_clicks
necessitates keeping track of clicks on each āblockā to be able to figure out which block was clicked most recently. Is there another way of handling this?
The current callback is as follows.
@app.callback(
Output('overview-table', 'children'),
[Input( 'sys_number_{}'.format(sys_info.sys_number), 'n_clicks') for i, sys_info in system_df.iterrows()],
)
def update_table(n_clicks, other_info):
# Do actions
return html.P('text')
Reading through previous threads I am canāt seem to find a solution to the above challenge, any pointers/suggestions will be greatly appreciated!