Hi Dash Team,
I have stumbled upon what I think is a Datatable virtualization bug, which took me a while to work out, but I have isolated it to the below simplified code.
For a Datatable, If you have virtualization=True, as well as using Style_data_conditional with filter_query on, if you click on any cell on the table, and use the keypad and scroll down to the last row, and click down on the keypad one more time, a “Cannot read property “id” of undefined” shows up, and halts the program. The style_data_conditional works without crashing if Virtualization = False
This also occurs if you mouse click the last row.
It seemed very similar to this Dash Table with row_selectable="multi" does not respond to data or columns callbacks · Issue #436 · plotly/dash-table · GitHub , but it was not quite the same problem.
Let me know if you see the same thing.
Also, I still need to use filter_query, if you do spot this as an error, any idea as to how I can achieve the same filter_query conditional formatting without breaking the app?
Regards
Marcus
import dash
import dash_table
import dash_html_components as html
app = dash.Dash(__name__)
params = [“id”,“col1”,“col2”,“col3”]
table = dash_table.DataTable(
id=‘table’,
columns=[{“name”: i, “id”: i} for i in params],
data=[{param: i for param in params} for i in range(1, 20)],
virtualization=True,
style_data_conditional=[{
‘if’: {
‘filter_query’: ‘{id} = 2’
},
‘backgroundColor’: ‘#D1EEEE’,
‘color’: ‘black’}
],
)
app.layout = html.Div([table])
if __name__ == ‘__main__’:
app.run_server(debug=True)