mike lebowski
27 Jan 2012, 9:51 PM
I have tabpanel with two tabs and a docked toolbar.
I want to dynamically set the title of the docked toolbar. Not knowing in advance the possible values of this title, it will be acceptable if longer titles show up truncated with elipsis as in "A long title blah ..."
However, what is not acceptable is for a long title to force the width of the entire container to be wider than the iphone view itself. And that is what is happening. If I set the title to be something long, the toolbar does not truncate the title as I hoped. Instead the toolbar is extended off to the right beyond the right border of the phone itself , which is not acceptable.
So what am I missing about containers and layouts that is getting me into this situation. After reading another thread, I even stopped using the title property of the toolbar, and instead used a child item of type title, in the hope that this would give me the control I needed. But i find myself with the same problem.
Here is my toolbar code:
items: [
{
xtype: 'toolbar',
itemId: 'titleBar',
docked : 'top',
items : [
{
xtype: 'title',
title: 'A very long title that I wish to be truncated by elipsis. I do not want this to widen the toolbar but it is, argh!',
flex: 4,
docked: 'left'
},
{
xtype: 'button',
itemId: 'favoriteButton',
iconCls: 'star',
iconMask: true,
docked: 'right',
flex: 1
}
]
},
The parent of this toolbar is an Ext.tab.Panel with a card layout.
Any suggestions?
I want to dynamically set the title of the docked toolbar. Not knowing in advance the possible values of this title, it will be acceptable if longer titles show up truncated with elipsis as in "A long title blah ..."
However, what is not acceptable is for a long title to force the width of the entire container to be wider than the iphone view itself. And that is what is happening. If I set the title to be something long, the toolbar does not truncate the title as I hoped. Instead the toolbar is extended off to the right beyond the right border of the phone itself , which is not acceptable.
So what am I missing about containers and layouts that is getting me into this situation. After reading another thread, I even stopped using the title property of the toolbar, and instead used a child item of type title, in the hope that this would give me the control I needed. But i find myself with the same problem.
Here is my toolbar code:
items: [
{
xtype: 'toolbar',
itemId: 'titleBar',
docked : 'top',
items : [
{
xtype: 'title',
title: 'A very long title that I wish to be truncated by elipsis. I do not want this to widen the toolbar but it is, argh!',
flex: 4,
docked: 'left'
},
{
xtype: 'button',
itemId: 'favoriteButton',
iconCls: 'star',
iconMask: true,
docked: 'right',
flex: 1
}
]
},
The parent of this toolbar is an Ext.tab.Panel with a card layout.
Any suggestions?