Code:
tree.getSelectionModel().on("selectionchange", function(selModel, node){
if (node.leaf) {
var newTab;
switch (node.attributes.url) {
case 'listGroupsByZone.html':
newTab = new Ext.ux.ListGroupsByZone();
break;
}
centerPanel.add(newTab).show();
}
}, this, true);
Ext.ux.ListGroupsByZone is:
Code:
var zonePanel = new Ext.FormPanel({
region: 'center',
//baseCls : 'x-plain',
frame: true,
labelWidth: 150,
labelAlign: 'right',
items: [{
title: langResStr_selectZoneAndSystemGroup,
frame: true,
layout: 'column',
items: [{
columnWidth: .5,
layout: 'form',
border: false,
items: [{
xtype: 'combo',
id: 'cmbZone',
fieldLabel: langResStr_zone,
listWidth: '100% -10',
mode: 'local',
store: [[1, 'Item 1'], [2, 'Item 2'], [3, 'Item 3'], [4, 'Item 4']],
triggerAction: 'all',
lazyRender: true,
anchor: '100%'
}]
}, {
columnWidth: .5,
layout: 'form',
border: false,
items: [{
xtype: 'checkbox',
id: 'chkSystem',
fieldLabel: langResStr_systemGroup,
anchor: '50%'
}],
}]
}, {
bodyStyle: 'padding: 0px 0px 3px 0px'
}, gridFnc()],
buttons: [{
id: 'btnOk',
text: langResStr_ok,
anchor: '50%'
}],
margins: '10px 10px 10px 10px'
});
return zonePanel;
}
and
Ext.ux.ListGroupsByZone = Ext.extend(Ext.Panel, {
id: 'listGroupsByZoneCenterPanel',
frame: true,
title: langResStr_groupsByZone,
closable: true,
initComponent: function(){
var zonePanel = zoneFnc();
Ext.apply(this, {
items: new Ext.Panel({
title: langResStr_groupsByZone,
layout: 'border',
items: [zonePanel]
}),
margins: '3px 3px 3px 3px'
});
Ext.ux.ListGroupsByZone.superclass.initComponent.apply(this, arguments);
}
});
Is it enough