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.