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 Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Gainesville, FL
    Vote Rating


    We will take a look.
    Mitchell Simoens @LikelyMitch
    Modus Create, Senior Frontend Engineer
    Need any sort of Ext JS help? Modus Create is here to help!

    Check out my GitHub:

  3. #3
    Sencha User 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