Yes,
My code is much longer and full of irrelevant data...the relevant snippets are below.
Toolbar and tree (both trees have similar configuration), only their stores are different
PHP Code:
myTree = Ext.extend( Ext.Panel , {
initComponent: function ( )
{
this.tbar = new Ext.Toolbar ({
items : [
new Ext.app.SearchField({
width : 190 ,
store: this.ds
}),
{ text : "",
icon : WebRoot + 'content/images/default/layout/ns-collapse.gif',
handler : function(){ this.tree.collapseAll(); }.createDelegate(this)
},{
text : "",
icon : WebRoot + 'content/images/default/layout/ns-expand.gif',
handler : function(){ this.tree.expandAll(); }.createDelegate(this)
},{
text : "",
iconCls : "icon-showAll",
handler : this.hideAllPushpins.createDelegate(this)
}]
})
//init the tree
this.tree = new Ext.tree.TreePanel({
animate : true,
rootVisible : false,
enableDD : true,
preloadChildren : true,
stateful : true,
containerScroll : true,
dragConfig : { hlColor:'#fff' },
allowContainerDrop : false,
allowParentInsert : false ,
appendOnly : true,
tbar: this.tbar
});
})
Viewport:
PHP Code:
this.northPanel = new Ext.Panel({ region: 'north', border: true, contentEl: 'header', height: 50 });
this.westPanel = new Ext.Panel({ region: 'west', id: 'westPanel', split: true, width: 300, border: true, layoutConfig: { renderHidden:true },
collapsible: true, titlebar: false, minSize: 300, maxSize: 400, title: ' ', layout: 'accordion'
});
this.southPanel = new Ext.Panel({ region: "south", id: 'southPanel', title: " ", height: 160, split: true, collapsible: true,
titleCollapse: true, collapsed: true, cmargins: '0 0 0 0', minSize: 120, maxSize: 300, layout: 'fit',
items: new Ext.TabPanel({})
});
this.mapPanel = new Ext.Panel ({ region: "center", contentEl: 'centerPanelDiv', split: true });
this.centerPanel = new Ext.Panel({ layout: 'border', region: "center", border: true,
items: [this.mapPanel, this.southPanel]
});
this.mainPanel = new Ext.Panel({ region: "center", layout: "fit",
items: [{
layout: "border",
items: [this.centerPanel, this.westPanel ]
}]
});
mapViewPort = new Ext.Viewport({
layout: 'border',
items: [this.northPanel, this.mainPanel]
});
//ContactTree and PlacemarkTree are extensions of ext.panel which contains one tree as defined above
contactTree = new myTree ();
placemarkTree = new myTree ();
this.westPanel.insert(0, contactTree.tree);
this.westPanel.insert(1, placemarkTree.tree);
contactTree.tree.expand();
this.westPanel.doLayout();