PDA

View Full Version : dockedItems ignoring title in item



profunctional
2 Jul 2010, 8:09 AM
I have added an icon + title into a toolbar that is docked at the bottom. The icon displays, but the title attribute is ignored. Any advice?



var dashboard = new Ext.Panel({
fullscreen: true,
layout: 'card',
items:
[
{
id: 'dashboardList',
xtype: 'nestedlist',
items: [],
toolbar: {
title: 'Dashboard',
items:
[
{
xtype: 'button',
ui: 'mask',
iconCls: 'refresh',
stretch: false,
handler: refresh
},
{
xtype: 'spacer'
},
{
xtype: 'button',
ui: 'mask',
iconCls: 'add',
stretch: false,
handler: function() {
alert('addJob');
}
}
]
}
}
],
dockedItems:
[
{
xtype: 'toolbar',
dock: 'bottom',
defaults: {
ui: 'mask'
},
layout: {
pack: 'center'
},
items:
[
{
xtype: 'spacer'
},{
iconCls: 'settings', title: 'settings',
}
]
}
]
});

TommyMaintz
2 Jul 2010, 11:37 AM
I don't see any title being defined.

If I run the following code, I see a title in the bottom toolbar.



var dashboard = new Ext.Panel({
fullscreen: true,
layout: 'card',
items: [{
id: 'dashboardList',
xtype: 'nestedlist',
items: [],
toolbar: {
title: 'Dashboard',
items: [{
xtype: 'button',
ui: 'mask',
iconCls: 'refresh',
stretch: false,
handler: function(){}
}, {
xtype: 'spacer'
}, {
xtype: 'button',
ui: 'mask',
iconCls: 'add',
stretch: false,
handler: function() {
alert('addJob');
}
}]
}
}],
dockedItems:[{
xtype: 'toolbar',
dock: 'bottom',
title: 'test',
defaults: {
ui: 'mask'
},
layout: {
pack: 'center'
},
items: [{
xtype: 'spacer'
}, {
iconCls: 'settings',
title: 'settings',
}]
}]
});

profunctional
3 Jul 2010, 3:47 AM
The settings button is what I am referring to in the code snippet.

rplotkin
6 Jul 2010, 4:41 AM
Having a toolbar with a title is a bit unconventional. This would probably work if you dock a panel with a title, and then have that panel's only item be your toolbar (no title on the toolbar).

profunctional
6 Jul 2010, 6:11 AM
you misunderstood the problem. Under my settings icon, there should be a small title that says Settings. If you look at their icons example, they do the same thing.

My prob is that only the con displays. No title is visible under the icon.

rplotkin
6 Jul 2010, 6:18 AM
Ah. That isn't a toolbar, it's a TabPanel with a config to put the tabs at the bottom. If you look at the source in the KitchenSink->Icons example, you'll see that the top is a docked toolbar, but the bottom is part of the TabPanel config.