Here is my code:
Ext.define('Ext.app.Portal', {
extend: 'Ext.container.Viewport',
uses: ['Ext.app.PortalPanel', 'Ext.app.PortalColumn', 'Ext.app.GridPortlet', 'Ext.app.ChartPortlet'],
getTools: function () {
return [{
xtype: 'tool',
type: 'gear',
handler: function (e, target, panelHeader, tool) {
var portlet = panelHeader.ownerCt;
portlet.setLoading('Working...');
Ext.defer(function () {
portlet.setLoading(false);
}, 2000);
}
}];
},
initComponent: function () {
var content = '<div class="portlet-content">' + Ext.example.shortBogusMarkup + '</div>';
Ext.apply(this, {
id: 'app-viewport',
layout: {
type: 'border',
padding: '0 5 5 5'
}, //eo layout
items: [{ //app-header : item 1 of app-viewport
id: 'app-header',
xtype: 'box',
region: 'north',
height: 40,
html: 'My Portal'
}, { //container : item 2 of app-viewport
xtype: 'container',
region: 'center',
layout: 'border',
items: [{ //app-options: item 1 of container
id: 'app-options',
title: 'Options',
region: 'west',
animCollapse: true,
width: 200,
minWidth: 150,
maxWidth: 400,
split: true,
collapsible: true,
layout: 'accordion',
layoutConfig: {
animate: true
},
items: [{ //portal: item 1 of app-options
title: 'portal',
autoScroll: true,
border: false,
iconCls: 'nav'
}, { //settings : item 2 of app-options
title: 'Settings',
html: '<div class="portlet-content">' + 'details ??' + '</div>',
border: false,
autoScroll: true,
iconCls: 'settings'
}] //eo items app-options
}, { //item 2 of container
id: 'app-portal',
xtype: 'tabpanel',
activeTab: 0,
region: 'center',
items: [{
title: 'tab1',
layout: 'column',
html: 'this is the first tab',
closable: true
}, {
title: 'tab2',
closable: true
} //eo tab2
] //eo items tabpanel
}]
}] //eo app-portal
}); //eo apply
this.callParent(arguments);
},
onPortletClose: function (portlet) {
this.showMsg('"' + portlet.title + '" was removed');
},
showMsg: function (msg) {
var el = Ext.get('app-msg'),
msgId = Ext.id();
this.msgId = msgId;
el.update(msg).show();
Ext.defer(this.clearMsg, 3000, this, [msgId]);
},
clearMsg: function (msgId) {
if (msgId === this.msgId) {
Ext.get('app-msg').hide();
}
}
});
Any help would be greatly appreciated.