1. #1
    Sencha User
    Join Date
    Nov 2011
    Posts
    10
    Vote Rating
    0
    sanlee is on a distinguished road

      0  

    Default Unanswered: how to update NavigationView title dynamically when I push in a view?

    Unanswered: how to update NavigationView title dynamically when I push in a view?


    Hi,

    I have a NavigationView, and I need to change the title dynamically, how can I do that?
    For example,

    navView.push(AList) -> navView.push(BList)
    The BList title should show some information related to the tapped item from AList.

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,632
    Answers
    3452
    Vote Rating
    817
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    You can change the title of the item being pushed.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    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 in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha User
    Join Date
    Jan 2012
    Posts
    13
    Vote Rating
    0
    koenoe is on a distinguished road

      0  

    Default


    And what if the panel already exists? When you pass an object (with the title) into setActiveItem() the content of the navigation panel doesn't refresh.

  4. #4
    Sencha User ggendre's Avatar
    Join Date
    Feb 2012
    Location
    Lannion, France
    Posts
    24
    Vote Rating
    0
    ggendre is on a distinguished road

      0  

    Default


    I have the same problem with setActiveItem : the title is not changing :

    Look at this small code, when I click on the back button, the title is changing. but when I click on the button that calls "setActiveItem" it doesn't... why ??

    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);
    	}
        
    
    
    });

  5. #5
    Sencha User
    Join Date
    Jan 2012
    Posts
    13
    Vote Rating
    0
    koenoe is on a distinguished road

      0  

    Default


    Just updated to the final version and it's fixed.