Destroying nad creating grid multiple times leads to infinite cycle

Hi,

I have an application displaying a grid with several columns. Also, the application provides a dropdown with several definitions of grid columns, sort settings, etc. If the user selects one of the definitions, the grid is destroyed and then rendered again with a new definition.

The problem is that after 3-4 selections, the destroy grid fails with error 'Uncaught TypeError: Cannot read property 'removeChild' of null' and cycles infinitely. This error occurs in controls/base/src/dom.ts:213. Then it goes on and return back to this line and cycles.

This hard to reproduce in sandbox and I understand this reproduction steps are not ideal. However, the null exception is obvious. I am using 18.2.59 version.

Uncaught TypeError: Cannot read property 'removeChild' of null
    at remove (dom.js:208)
    at Group.I3VE.Group.destroy (group.js:908)
    at ModuleLoader.jedy.ModuleLoader.clean (module-loader.js:56)
    at ModuleLoader.jedy.ModuleLoader.inject (module-loader.js:21)
    at Grid.wVVD.Component.injectModules (component.js:285)
    at Grid.wVVD.Component.dataBind (component.js:172)



3 Replies

SK Sujith Kumar Rajkumar Syncfusion Team September 24, 2020 12:50 PM UTC

Hi Stefan, 
 
Greetings from Syncfusion support. 
 
We checked your reported problem by rendering two Grids in separate pages and destroying the previous page Grid on switching but could not reproduce the problem from our end. Please check below sample for your reference, 
 
 
We suspect the problem might be occurring because of trying to destroy the Grid component that has already been destroyed. So please ensure this case and share us the following information to validate further on this, 
 
  • Code snippet of how you have destroyed and re-rendered the Grid.
  • Grid related code file.
  • Syncfusion package version used.
  • If possible share us a simple sample to replicate the problem or try reproducing it in the above provided sample. It would be helpful to identify your problem case better so that we can check and provide the solution based on that.
 
If you are using older Syncfusion packages, then please update them to the latest version and see if it resolves the problem. 
 
 
Let us know if you have any concerns. 
 
Regards, 
Sujith R 



SB sbartos November 3, 2020 01:58 PM UTC

Hi,

sorry for this delayed answer.

I am using 18.3.44 ej2. The problem seems to be with destroying a grid via destroy() method. The div element that was used for append this grid was not properly disposed. It contained 'width' property on it and also something else. I replace the clean div element(only with id) with the previous. It works now. However, the infinite cycle should be addressed.

Regards


SK Sujith Kumar Rajkumar Syncfusion Team November 4, 2020 11:17 AM UTC

Hi Stefan, 
 
Thanks for the update. 
 
We are still not able to reproduce your problem case from our end as we are not sure how you are re-rendering the Grid(after destroying) in your side. So can you please share us the code snippet for the same as requested in our previous update in order to validate further on this and provide you the proper solution for it. 
 
Let us know if you have any concerns. 
 
Regards, 
Sujith R  


Loader.
Up arrow icon