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,556
    Answers
    3931
    Vote Rating
    1272
      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! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

  4. #3
    Sencha User 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
  •