1. #1
    Sencha User
    Join Date
    Jan 2012
    Posts
    39
    Vote Rating
    0
    Answers
    5
    sc0ttman is on a distinguished road

      0  

    Default Answered: Best way to dynamically update the title of a NavigationView

    Answered: Best way to dynamically update the title of a NavigationView


    I'm doing some l18n and would like to know the best way of updating the title of a navigation.View,either by passing the title in directly, or having it refresh the title from the currently displayed view's 'title' property.

    Thanks

  2. Okay good to know, thanks for the info. Basically what I have in my controller now is:

    PHP Code:
    this.getMain().getNavigationBar().pushTitle(title);
    this.getMain().getNavigationBar().titleComponent.setWidth(100); 
    Seems to do the job.

  3. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,525
    Vote Rating
    871
    Answers
    3564
    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


    Sorry, have been very busy. The navigation bar gets the title from the backButtonStack property on the navigation bar. getTitleText is the method that handles this so you would have to update that array.
    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.

  4. #3
    Sencha - Sencha Touch Dev Team rdougan's Avatar
    Join Date
    Oct 2008
    Posts
    1,158
    Vote Rating
    6
    Answers
    93
    rdougan will become famous soon enough

      0  

    Default


    Unfortunately there simply is no easy way to do this in 2.0. If you were to attempt to do it, you will need to update that array like Mitchell said and then manually call a few functions. You'll need to look at the source of Ext.navigation.Bar in depth and figure it out.

    It is on the roadmap though, and will be doable at some point in the 2.x release schedule.
    Sencha Inc.
    Robert Dougan - @rdougan
    Sencha Touch 2 and Ext JS 4 Core Team Member, SASS/Theming Wizard.

  5. #4
    Sencha User
    Join Date
    Jan 2012
    Posts
    39
    Vote Rating
    0
    Answers
    5
    sc0ttman is on a distinguished road

      0  

    Default


    Okay good to know, thanks for the info. Basically what I have in my controller now is:

    PHP Code:
    this.getMain().getNavigationBar().pushTitle(title);
    this.getMain().getNavigationBar().titleComponent.setWidth(100); 
    Seems to do the job.

  6. #5
    Sencha User
    Join Date
    Aug 2011
    Location
    Mumbai, India
    Posts
    119
    Vote Rating
    4
    Answers
    11
    Sasha172 is on a distinguished road

      0  

    Default


    Hullo

    This works for me :

    Ext.getCmp('navigationPanelId')._navigationBar.titleComponent.setTitle("My New Title");

    Give it a shot and let me know