-
10 Dec 2012 11:15 PM #1
Answered: NavigationView problem with pop and push
Answered: NavigationView problem with pop and push
Hi all!
I have a problem with NavigationView. I could not push a new view as after popping some views from a NavigationView (Ext.navigation.View). Here is my code:
How to resolve it, how to make the push operation working?Code:navigationview.pop(); // or navigationview.pop(n) navigationview.push({xtype: 'button', text: 'New View'}); // nothing happens!
Thanks!
-
Best Answer Posted by mitchellsimoens
When you pop, it has to animate back so you have to wait for the anim to finish before pushing.
-
11 Dec 2012 9:23 AM #2
Are you sure that your navigationview variable holds a valid instance of an xtype navigationview? You can find out if you inspect it in the console:
console.log(navigationview)
-
12 Dec 2012 1:40 PM #3Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,624
- Vote Rating
- 435
- Answers
- 3106
When you pop, it has to animate back so you have to wait for the anim to finish before pushing.
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
12 Dec 2012 6:57 PM #4
That seems to be right as I think. I also spent my hours to find out how to resolve it but nothing found. I also tried the following code to test effects of animation but this works fine:
Code:navigationview.push(view1); navigationview.push(view2); navigationview.push(view3);
-
12 Dec 2012 6:59 PM #5
-
13 Dec 2012 4:07 PM #6
Try this:
Code:navigationview.setAnimation({ type: 'slide', duration: 200 }); var animation = navigationview.getAnimation(); animation.on({ animationend: function() { navigationview.push({xtype:'button', text:'New View'});},scope: navigationview, single: true }); navigationview.pop();
-
27 Dec 2012 6:48 PM #7
Thanks for your help. I finally used Container with card layout instead of NavigationView so I can avoid that problem.
-
28 Dec 2012 2:28 AM #8
The solution pointed above can work with any container using card layout (which is the case of NavigationView). If you change the navigationView object to use your container it should work as well.
Thanks


Reply With Quote