-
2 May 2012 12:35 AM #1
dynamic setTitle titlebar
dynamic setTitle titlebar
REQUIRED INFORMATIONExt version tested:
- Sencha Touch 2.0PR1
- Chrome 11 (Windows)
- Safari (iPhone)
- Ext.TitleBar - setTitle() don't cut the title
- When I want to set the title in a title bar dynamically the title is not been cut and the title text goed over the buttons
- Create a TitleBar insert this titlebar in another view at the painted event for that titlebar and call the setTitle() function.
- That when the title is to long the title will be cut
- The title was not cut
HELPFUL INFORMATIONScreenshot or Video:Code:{ xtype: 'topBarConversation', listeners : { painted: function(){ this.setTitle(MobileLogin._caseTitle); // a long title } } }- attached IMG_0317[1].jpg
- none
- not provided
- only default ext-all.css
- custom css (include details)
- Windows 7
-
2 May 2012 4:22 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,581
- Vote Rating
- 433
Have you tried in a final release like 2.0.1 not a PR release? This is working great for me:
Code:new Ext.Container({ fullscreen : true, items : [ { xtype : 'titlebar', docked : 'top', items : [ { xtype : 'button', ui : 'back', text : 'Back' }, { xtype : 'button', text : 'Reply', align : 'right' } ], listeners : { painted : function(bar) { bar.setTitle('Just a long title, nothing big'); } } } ] });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.
-
15 Nov 2012 2:03 PM #3
My title bar is not working properly also
My title bar is not working properly also
hi,
My title bar renders the long titles correctly only the first time the user opens the screen, but when opened after that it renders wrong and maybe above the Back button.
Here is a snippet of the code.
items: [{ xtype: 'titlebar', docked: 'top',
title: 'Album title', id: "albumsItemTitleBar", items: { text: 'Back' }
}],
var albumsItemTitleBar = Ext.getCmp('albumsItemTitleBar');
albumsItemTitleBar.setTitle(selectedAlbum);
Thank you for reporting this bug. We will make it our priority to review this report.


Reply With Quote