You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Seeing this is not supported. Is there a workaround where I could have two outputs in a single callback?
For example:
x = html.Div(id='div-1', children=[pandas_table])
y = html.Div(id='div-2', children=[html.P('status_bar')])
In the callback, I'd like to amend it so that once the function executes, x and y would be assigned different values depending on if statements such as:
if condition:
return render_pandas_table), html.P('Update successful')
where the order of returned items refers to the output's object I'm looking to modify.
Thanks!
The text was updated successfully, but these errors were encountered:
You could set up a callback function to return a different set of components. For example:
app.layout = html.Div([
dcc.RadioItems(id='radio', value='x', options=[{'label': i, 'value': i} for i in ['x', 'y', 'z']])
html.Div(id='output')
])
@app.callback(Output('output', 'children'), [Input('radio', 'value')])
def update_content(value):
if value == 'x':
return [html.Div('X was selected')]
elif value == 'y':
return [html.Div('Y was selected')]
elif value == 'z':
return [html.Div('Z was selected')]
that function can return any combination of components.
Seeing this is not supported. Is there a workaround where I could have two outputs in a single callback?
For example:
x = html.Div(id='div-1', children=[pandas_table])
y = html.Div(id='div-2', children=[html.P('status_bar')])
In the callback, I'd like to amend it so that once the function executes, x and y would be assigned different values depending on if statements such as:
if condition:
return render_pandas_table), html.P('Update successful')
where the order of returned items refers to the output's object I'm looking to modify.
Thanks!
The text was updated successfully, but these errors were encountered: