Grid ColumnChooser with InfiniteScrolling produces undefined access error when modifying columns visibility

Dear Syncfusion support team,


This error appeared after updating from "@syncfusion/ej2-angular-grids": "^21.2.9" to
"^23.1.44". When opening the column chooser and pressing the 'OK' button:

core.mjs:10614 ERROR TypeError: Cannot read properties of undefined (reading 'cells')
at setDisplayValue (ej2-grids.es5.js:23412:55)
at ContentRender.setDisplayNone (ej2-grids.es5.js:3875:9)
at ContentRender.setVisible (ej2-grids.es5.js:3852:22)

Image_1259_1700757631329


If the infiniteScroll is disabled, the error goes away but we need it so what we have is:

[enableInfiniteScrolling]="true"
showColumnChooser="true"


I couldn’t reproduce it on other pages or in stackblitz (or find any difference with those pages that work), but it happens in the setDisplayValue on this line because “rows” is empty for some reason

rows[trs[parseInt(i.toString(),
10)]].cells[parseInt(idx.toString(), 10)].visible = displayVal === '' ? true :
false;

and that comes from next code where this.rows.filter... returns an empty array

Image_9481_1700757631329


The functionality works and everything but this console error breaks our tests


Thanks for any reply,

Best regards,



César


1 Reply

VS Vikram Sundararajan Syncfusion Team November 24, 2023 01:05 PM UTC

Hi César Arismendi,


Greetings from Syncfusion support,


Based on your query, you are facing a console error when using the column chooser with infinite scroll. We have checked the reported error in the sample but were unable to replicate the issue. Please refer to the sample below for more information:


Sample: https://stackblitz.com/edit/angular-bdp3y3-pza3gr?file=src%2Fapp.component.ts


We recommend using the provided sample as a reference to resolve the reported behavior. If you are still experiencing the issue, please provide the following details for further validation:


  1. Are you using remote data to bind the data for the grid? If yes, please provide the data binding-related code. We need to ensure that the grid data is properly initialized and available before the ColumnChooser is opened. If you are using Infinite Scrolling, make sure that the data is loaded and available for the initial rendering as well as when the ColumnChooser is opened.
  2. Please share the complete grid rendering code. We need to check the grid configuration, especially the settings related to Infinite Scrolling and ColumnChooser.
  3. Could you please share some sample data used in your application? This will help determine whether the problem is related to the specific data being used or if it's a more general issue with the grid configuration.
  4. If possible, please provide us with a sample of the grid that reproduces the reported behavior. This will assist us in better understanding and validating your query.


Regards,

Vikram S


Loader.
Up arrow icon