1. #1
    Sencha User
    Join Date
    Feb 2012
    Posts
    39
    Answers
    3
    Vote Rating
    1
    Derroy is on a distinguished road

      0  

    Default Unanswered: Remove item from navigationstack without popping

    Unanswered: Remove item from navigationstack without popping


    I am trying to do the following

    from
    1: mainscreen
    2: news article list
    3: news article

    to
    1 : main
    2 : detail

    but when i press the menu button when im in view number 3 and choose a different option i want to remove an item from the navigation stack without the navigation view popping and pushing the other views at random.

    i tried using the following code:
    What happens now is that when i chose for example view number 2 it first animates back to the first view, the main screen, and after it animates to the newly pushed 2nd view

    Code:
    Ext.override(Ext.navigation.View, {    push: function(view){
            var innerItems = this.getInnerItems();
            for(x in innerItems) {
                if(innerItems[x] === view && this.getPreviousItem() != null)  {
                     //if view has to be recycled, remove it from the stack to push it again. suspend events to prevent pop/push animations on navigationview?
                    this.suspendEvents();
                    this.remove(view, false);
                    this.resumeEvents();
                }
            }
            return this.add(view); 
        },
        onBackButtonTap: function() {
            if(W2.app.getController('Main').lastUsedMenuItem == this.getActiveItem()) {
                this.pop('news');
            } else {
                this.pop();
            }
            this.fireEvent('back', this);
        },
    });
    tldr;
    from
    1 - Main
    2 - News
    3 - Detail view

    to
    1 - Main
    2 - Options

    help.

  2. #2
    Sencha Premium Member
    Join Date
    May 2011
    Posts
    71
    Answers
    5
    Vote Rating
    6
    cyee is on a distinguished road

      0  

    Default


    Have you tried building your own instance of Ext.app.History, and then setting it with YourApplication.setHistory() ?

  3. #3
    Sencha User
    Join Date
    Feb 2012
    Posts
    39
    Answers
    3
    Vote Rating
    1
    Derroy is on a distinguished road

      0  

    Default


    No i havent.. I have no idea what you are talking about (yet!)
    Maybe i should dig into routing and use that instead of the navigation view?

    *edit*

    so now i've overridden the Ext.app.history object and implemented routes. The problem is when i history.back() the history object doesnt remove the action from the stack... any ideas for that?
    Last edited by Derroy; 20 Feb 2013 at 12:40 AM. Reason: no double posting!

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