Quantcast
Channel: 🎛️ Dash - Plotly Community Forum
Viewing all articles
Browse latest Browse all 6271

Save/load layout of dropdowns and values after page refresh or tab change

$
0
0

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

Read full topic


Viewing all articles
Browse latest Browse all 6271

Latest Images

Trending Articles



Latest Images