Hybrid View

  1. #1
    Sencha User
    Join Date
    Sep 2011
    Location
    San Mateo, CA, USA
    Posts
    8
    Vote Rating
    0
    jkobilka is on a distinguished road

      0  

    Default Answered: Canceling callbacks

    Answered: Canceling callbacks


    I have a ST 2.1 application that is set up so that each page/section has its content loaded asynchronously from a store on initialization. I also have routes set up so that each page is accessible via URL, and the phone's back button can be used to navigate.

    The issue I'm seeing is that if the user navigates to a new page, its content will begin to load, but if the user clicks the "back" button on their phone, it'll navigate to the previous view per my app's route function, but the load callback I had continues to survive, and will execute once the load completes.

    Is there any way to cancel all currently active loads and their callbacks? I'd like to have some action that goes into each route function which cancels any loads that may be taking place. Each page is linked to a number of other pages, so I can't go and individually handle all the combinations very easily.

    Any help would be appreciated!

  2. If you are using Ext.Ajax, it has an abort method that you can pass the request you want to abort.

  3. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    35,704
    Answers
    3356
    Vote Rating
    751
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    If you are using Ext.Ajax, it has an abort method that you can pass the request you want to abort.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  4. #3
    Sencha User
    Join Date
    Sep 2011
    Location
    San Mateo, CA, USA
    Posts
    8
    Vote Rating
    0
    jkobilka is on a distinguished road

      0  

    Default


    Thanks, Mitchell. I'm using JSONP, so Ext.data.JsonP.abort() was the way to go. The only issue now is that I have to make sure to avoid canceling requests until the initial load has completed. Thanks!


    Quote Originally Posted by mitchellsimoens View Post
    If you are using Ext.Ajax, it has an abort method that you can pass the request you want to abort.

Thread Participants: 1

Tags for this Thread

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar