Results 1 to 5 of 5

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

  1. #1
    Sencha User
    Join Date
    Jan 2012
    Posts
    39
    Answers
    5
    Vote Rating
    0
      0  

    Default 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 - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,320
    Answers
    3883
    Vote Rating
    1293
      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 @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it!

    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,159
    Answers
    93
    Vote Rating
    7
      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
    Answers
    5
    Vote Rating
    0
      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
    120
    Answers
    11
    Vote Rating
    4
      0  

    Default

    Hullo

    This works for me :

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

    Give it a shot and let me know

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •