Hello,
I want to select all value in of a search in a dropdown menu. I am not sure I can do it with the dash component.
My data looks like this
t1 – s
t2 – s
t3 – s
d1 – m
d2 – m
d3 – m
I set up a mutli dropdown witch is by default searchable
When I search for « s » in my dropdown menu I get the first three results . I would like to know if I can select them in just one click. For know I have to select them one after another.
Is it possible to do this with the dash dropdown ?
Here is the simple code:
import dash
import dash_html_components as html
import dash_core_components as dcc
external_stylesheets = [‘https://codepen.io/chriddyp/pen/bWLwgP.css’]
app = dash.Dash(name, external_stylesheets=external_stylesheets)
app.layout = html.Div([
dcc.Dropdown(
id=‘my-dropdown’,
options=[
{‘label’: ‘t1 – s’, ‘value’: ‘t1 – s’},
{‘label’: ‘t2 – s’, ‘value’: ‘t2 – s’},
{‘label’: ‘t3 – s’, ‘value’: ‘t3 – s’},
{‘label’: ‘d1 – m’, ‘value’: ‘d1 – m’},
{‘label’: ‘d2 – m’, ‘value’: ‘d2 – m’},
{‘label’: ‘d3 – m’, ‘value’: ‘d3 – m’}
],
multi=True
),
html.Div(id=‘output-container’)
])
@app.callback(
dash.dependencies.Output(‘output-container’, ‘children’),
[dash.dependencies.Input(‘my-dropdown’, ‘value’)])
def update_output(value):
return ‘You have selected “{}”’.format(value)
if name == ‘main’:
app.run_server(debug=True)