Results 1 to 3 of 3

Thread: Pop to root view for Ext.navigation.View

    Success! Looks like we've fixed this one. According to our records the fix was applied for TOUCH-1367 in a recent build.
  1. #1
    Sencha User
    Join Date
    Sep 2011
    Vote Rating

    Smile Pop to root view for Ext.navigation.View

    This is actually an enhancement request with a reference implementation rather than a bug. I mentioned the solution in a question thread yesterday, so I apologize if I'm being annoying by posting this here as well.


    Ext version tested:
    • Sencha Touch 2.0 PR3

    Browser versions tested against:
    • IE8
    • FF3 (firebug installed)
    • Safari 4

    • There is no predefined way to pop multiple views from an Ext.navigation.View in one operation.

    Steps to reproduce the problem:
    • Create an Ext.navigation.View
    • Add multiple views to it
    • Try to pop to the top view in one operation

    The result that was expected:
    • Should be able to pop to the root view or to any view in-between directly rather than just one view at a time.

    The result that occurs instead:
    • Under the current code a user would have to press the back button for each view on the navigation view. In some circumstances it could be desired / required to move directly to a specific view on the stack or to the root view.

    Possible fix:
    • The following code is a reference implementation of a pop to root. A similar routine could be developed to pop to a specific view in the stack. I recommend adding something like this to the navigation view implementation -- I think many people would find it useful.
          popToRoot: function(destroy)
              var navBar = this.getNavigationBar(),
              stackLn = this.stack.length,
              //just return if we're at root
              if(stackLn <= 1) return;
              //just return if we're already animating
              if(navBar && navBar.animating) return;
              //splice the stack to get rid of items between top and root
              stackRm = this.stack.splice(1, stackLn-2);
              //remove views that were removed from the stack if required
              if(destroy) {
                  stackRm.forEach(function(val, idx, arr) {
                      this.remove(val, true);
              //clear out back button stack
              navBar.backButtonStack = [];
              //now we can do a normal pop

  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Gainesville, FL
    Vote Rating


    We will take a look.
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    Learn BBCode and use it!

    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2

    Think my support is good? Get more personalized support via a support subscription.

    Need more help with your app? Hire Sencha Services

    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.

  3. #3
    Sencha - Sencha Touch Dev Team rdougan's Avatar
    Join Date
    Oct 2008
    Vote Rating


    This will be in the next release as a Ext.navigation.View#reset method.
    Sencha Inc.
    Robert Dougan - @rdougan
    Sencha Touch 2 and Ext JS 4 Core Team Member, SASS/Theming Wizard.

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