-
9 Mar 2012 5:57 AM #1
setActiveItem on navigationView does not change the title
setActiveItem on navigationView does not change the title
hi,
In the senchatouch2 final version, the setActiveItem method of navigationView is not properly changing the title of its navigationBar.
see code below :
When I hit the "back" button the title change.Code:Ext.application({ name:'myApp', launch:function () { var view = Ext.create('Ext.NavigationView', { fullscreen:true, items:[ { id:'mySecondView', title:'Second', html:'Second view!' }, { title:'First', items:[ { xtype:'button', text:'show the other view!', handler:function () { view.setActiveItem('mySecondView'); } } ] } ] }); Ext.Viewport.add(view); } });
when I push views, the title change.
but setActiveItem does not change it.
Why ?
Is there a workaround ?
ThanksLast edited by ggendre; 9 Mar 2012 at 6:02 AM. Reason: code presentation was broken
-
9 Mar 2012 7:29 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,684
- Vote Rating
- 435
You should use push and pop to navigate through the navigation view.
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.
-
14 Mar 2012 3:42 AM #3
Okay for the pop() and push() but I don't want to re-create my view.
The documentation is saying I can use setActiveItem to change between existing views.
I think the title should change, and that's probably a bug, don't you ?
The title was changing before beta 3 and is not changing since RC...
-
14 Mar 2012 3:57 AM #4Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,684
- Vote Rating
- 435
setActiveItem is inherited. If you use setActiveItem you are not using navigation view the way it is intended. It is intended for push and pop to be used.
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.
-
8 Jun 2012 5:53 AM #5
But if you are trying to go directly to a view and don't know which one is currently active, you will want to use setActiveItem(). Just saying this is not the intended use does not answer the question. You cannot anticipate every application requirement. setActiveItem should work as specified and the title should be set correctly. Is there a workaround?
-
8 Jun 2012 7:21 AM #6Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,684
- Vote Rating
- 435
In 2.1.0 we will be able to use ComponentQuery to figure out what to pop to meaning you can pass a selector and it will figure out what view to pop to making it the active item. The title is based on using push or pop
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.
-
6 Jul 2012 11:02 PM #7
As mitchellsimoens said, do not recommend using setActiveItem(), because setActiveItem() will destroy the structure of navigation.
Ext Every Day!
ajaxjs.com
-
6 Jul 2012 11:20 PM #8
As mitchellsimoens said, do not recommend using setActiveItem(), because setActiveItem() will destroy the structure of navigation.
Ext Every Day!
ajaxjs.com
Looks like we can't reproduce the issue or there's a problem in the test case provided.


Reply With Quote