Is there a way to change the options available to the cell-rendered dropdown?
*sorry I’m having trouble formatting the text as code in this post
Declaration of drop down options in data-table:
dash_table.DataTable(
id=‘table-dropdown’,
data=df.to_dict(‘rows’),
columns=[
{‘id’: ‘climate’, ‘name’: ‘climate’, ‘type’: ‘dropdown’},
{‘id’: ‘temperature’, ‘name’: ‘temperature’},
{‘id’: ‘city’, ‘name’: ‘city’, ‘type’: ‘dropdown’},
],
editable=True,
column_static_dropdown=[
{
'id': 'climate',
'dropdown': [
{'label': i, 'value': i}
for i in df['climate'].unique()
]
},
{
'id': 'city',
'dropdown': [
{'label': i, 'value': i}
for i in df['city'].unique()
]
},
]
),
Changing of drop down options with callback on normal dropdown:
@app.callback(
dash.dependencies.Output(‘my-dropdown’, ‘options’),
[dash.dependencies.Input(‘my-input’, ‘value’)])
def update_output(value):
return [{‘label’: value, ‘value’: value}]
I can’t think of any component property of the data-table that I would access to achieve this.