Open OliverCrowe opened 2 years ago
Just to confirm, I can also reproduce the error.
This came up recently on the forum as well and was reported by @mcsewhoy https://community.plotly.com/t/virtualization-true-and-style-data-conditional-filter-query-causes-error/55176
It looks like this issue started with Dash v 1.12.0 and dash-table v4.7.0 Prior versions work fine.
Here is another MWE for reference: You will get the error if you click on a cell at or near the bottom of the table.
import dash_table
import dash_html_components as html
app = dash.Dash(__name__)
params = ["id", "col1", "col2", "col3"]
table = dash_table.DataTable(
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": "{col1} = 12"},
"backgroundColor": "#D1EEEE",
"color": "black",
}
],
)
app.layout = html.Div([table])
if __name__ == "__main__":
app.run_server(debug=True)
Dash version: 1.21.0 Dash-Table version: 4.12.0
Same issue in Firefox 91.0.2
Hello, It seems like the issue with "Cannot read properties of undefined (reading '')" when virtualization = True also happens for dash-table 5.0.0 dash 2.0.0
Could you please provide a fix? Without virtualization dash-table does not really help for analysing big sets of data...
Native paging throws the same error "Cannot read properties of undefined"
Dash version: 1.21.0 Dash-Table version: 4.12.0 Browser: Both Chrome and (new) Edge were tested
When a table has virtualization enabled, and some conditional data styling which uses filter_query, scrolling the table down outside the starting view and clicking on a cell causes the console error: TypeError: Cannot read property XXXX of undefined. In the example below, XXXX = Country, and changing the filter_query column to another value changes this error to that value. Both virtualization without the filter_query styling, and the styling without virtualization work as expected without this error.
This error causes the entire table to stop responding, any filtering or sorting options will not work until the page is refreshed, and no more cells can be selected.
Example: This code is taken from the documentation on virtualization https://dash.plotly.com/datatable/virtualization The filter_query styling is all that has been changed.