Results 1 to 2 of 2

Thread: Stop scripts running when window closed with right corner cross button [x]

  1. #1

    Default Stop scripts running when window closed with right corner cross button [x]

    Hello,

    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,

    Erwan

  2. #2
    Sencha User
    Join Date
    Feb 2013
    Location
    California
    Posts
    11,985

    Default

    Would it work to eliminate the close tool from the window?
    http://docs.sencha.com/extjs/3.4.0/#...w-cfg-closable

  3. #3

    Default

    Hello Gary,

    Thank you for replying so fast.

    In fact this problem concerns many functionalities of the software (the [x] button case is just an example to explain the problem I'm facing).

    Thus, rather than preventing the user from accessing functionalities I'd prefer to implement a "global" mechanism or use an instruction which in order to stop running scripts.

    In my opinion, an instruction (in the taste of "Ext.Manager.stopAll()") would be the easiest way to resolve this problem.

    Would you recall an instruction of this kind ?

    Do you have any advice about managing this issue ?

    Thank you, regards,

    Erwan

Similar Threads

  1. Replies: 1
    Last Post: 19 Apr 2012, 9:14 AM
  2. [4.0.1] Scripts not running when tab is clicked
    By cgum in forum Ext: Discussion
    Replies: 0
    Last Post: 9 Jun 2011, 7:16 PM
  3. Tool tip as 'close' on cross button in a window
    By awanish in forum Ext 3.x: Help & Discussion
    Replies: 5
    Last Post: 10 Sep 2010, 6:24 AM
  4. Scripts Don't Load and Stop
    By SIDGEY in forum Ext 2.x: Help & Discussion
    Replies: 2
    Last Post: 16 Feb 2010, 7:57 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •