Hello,
I try to fire dynamic callback on MATCH properties. But I want to also save some information during that event into a non dynamic component (for displaying). However if I use MATCH it does not accept non MATCH output.
I have a work around with ALL and context.trigger but this seem very tricky regarding that the function MATCH is already here for that purpose.
This is some code to help you visualize.
@app.callback(Output('abitrary_div','children'), Input('arbitrary_elment','property'))
def foo_callback(property):
data = []
for k in range(n):
data_tab.append(
html.A(
id = {'type' : 'clickable_entry', 'index' : k}
)
)
data_tab.append(
html.Div(
id={
'type': 'dynamic-output',
'index': k
},
hidden = True
)
)
return None, data_tab, data
@app.callback(
[
Output({'type': 'dynamic-output', 'index': MATCH}, 'children'),
Output('loading_div_main','children')
],
[
Input({'type' : 'clickable_entry', 'index' : MATCH}, 'n_clicks'),
],
[
State({'type' : 'clickable_entry', 'index' : MATCH}, 'id'),
]
)
def render(n_clicks): id, href, children):
if n_clicks:
page_layout = render_layout(id)
return page_layout
else:
raise PreventUpdate
If someone knows why it is not possible if we can’t do such things I would love to know why.
Thanks