Code:
var w = new Ext.Window({
xtype: 'window',
title: 'My Window',
width: 800,
height: 600,
layout: 'border',
items: [
{
xtype: 'panel',
title: 'My Panel',
region: 'center'
},
{
xtype: 'panel',
title: 'My Panel',
region: 'west',
width: 100,
margins: '0 5 0 5'
},
{
xtype: 'panel',
title: 'My Panel',
region: 'east',
width: 100,
margins: '0 5 0 5'
},
{
xtype: 'panel',
region: 'north',
ref: 'Header',
height: 100,
margins: '5 5 5 5',
tpl: new Ext.XTemplate(
'<div class="title">{title}</div>',
'<div class="subtitle">{subtitle}</div>'
),
bbar: [
{ xtype: 'button', text: 'Menu button 1' },
{ xtype: 'button', text: 'Menu button 2' }
]
},
{
xtype: 'panel',
title: 'My Panel',
region: 'south',
height: 100,
margins: '5 5 5 5'
}
],
fbar: {
xtype: 'toolbar',
items: [
{
xtype: 'tbfill'
},
{
xtype: 'button',
text: 'Header 1',
handler: function() {
w.Header.update({
title: 'Title 1',
subtitle: 'Subtitle 1'
});
}
},
{
xtype: 'button',
text: 'Header 2',
handler: function() {
w.Header.update({
title: 'Title 2',
subtitle: 'Subtitle 2'
});
}
},
{
xtype: 'button',
text: 'Header 3',
handler: function() {
w.Header.update({
title: 'Title 3',
subtitle: 'Subtitle 3'
});
}
}
]
}
});
w.show();