I want to be able to create a DataTable and pass it, so I can continuously create a DataTable that has a dynamic set of columns.
If I select 3 column names in a multi-dropdown, for example, I’d like to create a DataTable with just those 3 columns.
@app.callback(
[Output('count_table', 'children')]
[Input("slider", "value"), Input("statuses", "value")]
)
def update_table(slider, statuses):
df = filter_dataframe(data, slider, statuses)
return dash_table.DataTable(
columns=[{"name": i, "id": i} for i in df.columns],
data=df.to_dict('records'),
)
Is this possible to do? Is there another way I can do this other than passing a DataTable through a callback?