Handsontable collapse and expand all is not working when there are more than 5000 records rendered

Tags: #<Tag:0x00007efc653919e0>

Hi Team,

We have got a grid which loads more then 5000 records every time. Our grid is with nested items. Whenever we did collapse all after immediate loading of the grid we are getting the error as “Uncaught TypeError: Cannot read property ‘__children’ of null” . Because of this error we are unable to expand the collapsed records. Please note this issue is coming when we did the collapse all immediate load of the grid. If we wait for sometime after grid rendering and if we do collapse all we are not getting any error.

Kindly help on this. Please let us know if you required further information.

Thank you in advance.

Hi @Lokesh_Rajana

Please fill this demo with your grid settings https://jsfiddle.net/AMBudnik/jo24y0nh/

The default setup does not produce this error under version 8.1.0 so I assume that there are some extra settings that my cause it.

Hi @aleksandra_budnik

Thanks for your quick reply. I have updated the grid settings in the jsfiddle link which you provided. Please check and let me know if you need any further information.

Please find other information below:

  1. Our Handsontable Pro version : 2.0.0
  2. Our grid width and height are 1100 and 400 respectively.
  3. We have kept two buttons as Collapse all and expand all. On click of these buttons we are calling the below code:

hot.getPlugin('nestedRows').collapsingUI.collapseAll();
hot.getPlugin('nestedRows').collapsingUI.expandAll();

Also Please note when we have less number of records we are not getting the error. If we have more number of records then only we are getting this error.

Thanks in advance.

Unfortunately, the link does not update automatically in JSFiddle. You need to click ‘Fork’ and you’ll be provided with a new URL.

Hi @aleksandra_budnik

Please find the jsfiddlle link : https://jsfiddle.net/73d08egb/2/

Hi @aleksandra_budnik

I have also attached errors for your reference. Please check

Hi @Lokesh_Rajana

I added the button as they were missing and it seems to work fine https://jsfiddle.net/AMBudnik/m9xv2ajr/

I am testing the example on macOS Catalina 10.15.6 and Chrome 86.

Hi @aleksandra_budnik

Thank you for your reply.

Same code is working for us also when we have less than 1000 records in the grid. When we have more then 1000 records and if we click on collapse all immediately after grid load we are facing the issue. If we click on collapse all after some seconds of grid load we are not getting any error. Do you know the reason why it is giving error if we have more than 1000 records?

Thanks in advance.

We can test 1000+ rows in a demo (some time ago I’ve made a nestedRows generator for occasions like this one).

Here’s an updated demo https://jsfiddle.net/AMBudnik/mdakbsv8/ with (as countRows() says) 1640 rows.

Thank you for your support @aleksandra_budnik

We will check and get back to you if we need any further assistance.

If that or something else would concern you please feel free to send me an email at support@handsontable.com