In a sencha touch 2 Ext.navigation.View, it is possible to push() and pop() other views in and out. Those other views fire events like hide and show.Sadly, those events are fired in this order when pushing: (note the bold ones)
- initialize
- hide
- activate
- show
and like this when popping:
- deactivate
- hide
- show
- remove
- destroy
So relying on either show or hide event is not the best idea as both get fired in both situations.
I consider this a bug and something similar has already been discussed. Nevertheless this behaviour is still present in the version I use (ST 2.0.1.1) and according to the explanation of @rdougan in the forum:
The reason behind this is that when an item is removed from a card
layout, it may actually be shown somewhere else – or perhaps it is
changing to be floatable. So we must revert the item back to its
original visible state.
it won’t be changed as well. So I was trying to find out which event is really happening.
There is a solution for this problem. Assuming one listens to the event inside the view, not a controller, you may use this litte snippet:
to check whether your view is actually shown (
true) or hidden (false). Of course, you have to define your ownxtypeconfig property on the views you are using to make that work. In my case, it is anExt.Panel.