Here is a short example:
app.layout = html.Div([
html.Div([
dash_table.DataTable(
id='table',
columns=(
[{'id': 'col1', 'name': 'col1'}] +
[{'id': 'col2', 'name': 'col2'}]
),
data=[{'col1': i, 'col2': i} for i in range(1000)],
style_table={
'height': 240,
'width': 290,
'overflowY': 'auto'
},
editable=True,
page_action='none',
virtualization=True
)
],
id='table_div',
style={'display': 'none'}
),
html.Button('hide/show', id='btn')
])
@app.callback(
Output('table_div', 'style'),
[Input('btn', 'n_clicks')]
)
def func(clicks):
if clicks is None:
raise PreventUpdate
if clicks % 2 == 0:
return {'display': 'none'}
return {'display': 'block'}
Would really appreciate help if someone has dealed with this bug before.