Reputation: 27350
Can anyone show how I can set the alignment of the title in a title bar to left justified. I'm currently trying this but it isn't working:
var p = Ext.create('Ext.Panel', {
items: [
{
xtype: 'toolbar',
docked: 'top',
title: 'my title',
style: {
'text-align':'left'
}
}
]
});
Ext.Viewport.add(p);
2nd attempt: Not now able to have the title left and the toolbar button right!
var p = Ext.create('Ext.Panel', {
items: [
{
xtype: 'toolbar',
docked: 'top',
layout: {
pack: 'end'
},
title: {
title: 'mytitle',
style: {
'text-align':'left'
}
},
items: [
{
xtype: 'button',
text: 'mybutton',
align: 'right'
}
]
}
]
});
Ext.Viewport.add(p);
Upvotes: 1
Views: 5257
Reputation: 823
You are trying to add style to the toolbar but not to the title element. Do this:
xtype: 'toolbar',
docked: 'top',
title: {
title: 'my title',
style: {
'text-align':'left'
}
}
Look this http://jsfiddle.net/xv67e/
Upvotes: 2
Reputation: 28563
You can give items of a Ext.TitleBar an align configuration of left or right which will dock them to the left or right of the bar.
Upvotes: 0