【发布时间】:2021-10-16 06:48:58
【问题描述】:
我想知道是否可以保存下拉列表的选定值并默认将其放在具有相同值但位于另一个选项卡中的下拉列表中:
uriCounts 选项卡
dcc.Tab(label='uriCounts', value = 'es_uricounts', children = [
html.Div([
html.Br(),
html.H3("Choose uriCounts file version: "),
dcc.Dropdown(id='uriCounts_dropdown',options=[
{'label': 'Oct 1st 2016', 'value': 'Oct 1st 2016'},
{'label': 'Oct 1st 2020', 'value': 'Oct 1st 2020'},
{'label': 'May 25th 2021', 'value': 'May 25th 2021'},
{'label': 'Jun 25th 2021', 'value': 'Jun 25th 2021'}],
placeholder="Version"),
html.Br(),
html.Div(id='uriCounts_container')
],style = {'margin-left': '3.2552083333333335vw', 'margin-right': '3.2552083333333335vw'})
], style = tab_style, selected_style = tab_selected_style)
pairCounts 选项卡
dcc.Tab(label='pairCounts', children = [
html.Div([
html.Br(),
html.H3("Choose pairCounts file version: "),
dcc.Dropdown(id='pairCounts_dropdown',options=[
{'label': 'Oct 1st 2016', 'value': 'Oct 1st 2016'},
{'label': 'Oct 1st 2020', 'value': 'Oct 1st 2020'},
{'label': 'May 25th 2021', 'value': 'May 25th 2021'},
{'label': 'Jun 25th 2021', 'value': 'Jun 25th 2021'}],
value=**uriCounts_value**),
html.Br(),
html.Div(id='pairCounts_container')
], style = {'margin-left': '3.2552083333333335vw', 'margin-right': '3.2552083333333335vw'})
], style = tab_style, selected_style = tab_selected_style)
当您在uriCounts 选项卡的下拉列表中选择一个值时,我希望pairCounts 选项卡的下拉列表具有该值。
如果它可以以相反的顺序完成,那就太好了:首先在pairCounts选项卡的下拉列表中选择一个值,然后在uriCounts选项卡的下拉列表中选择该值
希望你能帮我解决这个问题。提前致谢。
【问题讨论】:
标签: plotly plotly-dash dashboard plotly-python