I have a Data Table in one page of my multi-page app layout:
... preceding code
html.Div([
dcc.Dropdown(
id='dropdown',
options=[{'label': name, 'value': name} for name in another_variable]
)
]),
html.Div(children=[
html.Div(
id='table-container',
className="twelve columns",
children=[
dash_table.DataTable(
id='table',
columns=[{"name": i, "id": i} for i in mip_solr.search('*:*',rows=1).docs[0].keys()],
data=[{}],
sorting=True,
sorting_type="multi",
filtering=True
)
]
)
more code...
and this callback
@app.callback(
Output('table', 'data'),
[Input('dropdown', 'value')]
)
def my_data_table(dropdown_value):
results = mip_solr.search('*:*',**{
"fq":[f"PS:\"{dropdown_value}\""],
"rows":"100"
})
return [result for result in results]
Tables successfully updates, but I cant’ sort or filter even though I have those options enabled. Any ideas?