Hello,
I generate new Dropdowns via a Button and a Callback like this :
@app.callback(
Output('category-dropdown', 'children'),
[Input('add-item', 'n_clicks')],
[State('category-dropdown', 'children')])
def category_dropdown(n_clicks, children):
new_dropdown = dcc.Dropdown(id={'type': 'filter-category','index':n_clicks },options=[{'label': i, 'value': i } for i in newlist])
children.append(new_dropdown)
return children
The Dropdowns are used to select data from a database.
This is working fine at the moment.
Now the problem: After refreshing the page or changing the tab the Dropdowns set back to 0. I managed to store the amount of n_clicks, but I don’t know how to loop through the callback.
Is it somehow possible to save and load the layout and the values inside the dropdown ?
Thanks in advance!
9 posts - 2 participants







