Dhx.window.destructor error if text controlls in form


I’m running a script to destruct a window containing a form.
If the form has any input/textarea type controlls, script error occurs.
pls confirm. thx

Hello, I noticed that if you use the awaitRedraw function the error does not occur.

function destroy() {
    dhx.awaitRedraw().then(() => {

However, I have this problem using DHTMLX Optimus, up to version 8.3.7 it works normally, after that an exception occurs. I have a window, and I switch between the views (with layout and form attached), through events, and when call the destroy() method of the view to be removed, the following error occurs:

@sematik could you do some tests trying to simulate the error please? At the moment I didn’t have time to make a demo available, but if I can’t simulate it I can take some time to do it.

Thank you very much in advance

In the same way I managed to “solve” the problem by first removing the old view, and using awaitRedraw to attach the new view.

However, these exceptions should not occur, I think.

dhx.awaitRedraw().then(() => {
   this.show(this.layout.getCell("containerEditLayout"), selectedTab, {...});

Hello, @sematik I noticed that the problem with destructor was fixed automatically. However, if I call layout.destructor() explicitly, an exception is thrown. Below is the previous example in an updated form within the destroy() function:


Edit: in this case I have a layout attached to the window, and the form is attached to the layout.


You should wait until layout destructs, and destruct the window only after the layout destructed:

So, as the demo illustrated, could I conclude a general recursively destroy template:

function Current_destroy(){
  Son1_destroy(); Son2_destroy(); // If Exsits