1. #1
    Sencha User
    Join Date
    Dec 2011
    Location
    New york, NY
    Posts
    16
    Answers
    1
    Vote Rating
    0
    mbharathiraj is on a distinguished road

      0  

    Default Unanswered: Abort store load requests

    Unanswered: Abort store load requests


    Hi,

    I have a window with a tab panel that has two tabs. Each tab contains a grid panel. Data will be loaded to the grid(multiple ajax requests) while opening the window using store load method. The issue is if the user closes the window before the store request completes then there is a javascript error thrown 'Store is null'.

    My question is when user closes the window, how can I abort all the store requests?

    Can someone please help?

  2. #2
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    8,935
    Answers
    656
    Vote Rating
    443
    scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future

      0  

    Default


    You can abort the request:

    Code:
    var ajaxId = Ext.Ajax.request({ .. }); 
    Ext.Ajax.abort(ajaxId);
    Regards,
    Scott.

  3. #3
    Sencha User
    Join Date
    Dec 2011
    Location
    New york, NY
    Posts
    16
    Answers
    1
    Vote Rating
    0
    mbharathiraj is on a distinguished road

      0  

    Default


    Scott - Thank you very much for your quick reply.

    I'm using Ext.getCmp('myGrid').store.load() to load the data in the grid. I also tried Ext.Ajax. abortAll() method in the window close. But I got the error 'Object doesn't support this property'.

    So you mean I should use Ext.Ajax.request instead of store.load(). Sorry If I misunderstood your post.

  4. #4
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    8,935
    Answers
    656
    Vote Rating
    443
    scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future

      0  

    Default


    I saw ajax in your original post ..
    You can use data.connection.abort() to cancel last request.

    Regards,
    Scott.

Thread Participants: 1