View Full Version : Ext JS 3.2.1 - Stop scripts running when window losed with cross button [x]

1 Dec 2016, 8:02 AM

Sorry if the subject has already been treated. If it's the case, please give me the link.

I'm working on an application with Ext JS in version 3.2.1.

The problem I encounter is Javascript referencing properties of elements from a closed window which causes null reference errors.

Here are the details.

The application opens on a main window with links. When the user clicks on 1 of these links, a new window appears.
Then, after various manipulations in this window, the user submit the formular.

The submit action is handled with a "doAction" instruction. Inside this instruction, in the callback, some instructions refer elments from the current window before closing it.

The problem occurs when it takes time on the server side (after submitting - eg : database maniupulations, ... ).
When it's the case, the user often looses patience and quits the window by clicking on the right corner cross button [x].
Then the callback from the "doAction" instruction fires and references elements from the the window which has been closed by the user, and that causes Javascript errors.

Do you know if there's a simple instruction with ExtJS which permits to stop all running scripts ?
Otherwise, what mechanism could you recommend to implement to prevent those errors ?

Thank you, regards,


Gary Schlosberg
1 Dec 2016, 9:06 AM
Duplicate: https://www.sencha.com/forum/showthread.php?332707