[Users] load different grid on tabPanel event listener
Robert Buckley
robertdbuckley at yahoo.com
Mon Apr 4 21:04:47 CEST 2011
Hi,
I have a viewport which holds a tabbed panel and a panel for a grid.
The tabbed panel holds 3 different mappanels.
I would like to load a different grid according to which mappanel is set to
active.
I can kind of see where I could program this but can see which events need to be
fired.
Can anyopne help?,
here is my code so far...
my grids are "named grid_wea", "grid_biogas", and "grid_wasser "
// mapPanels
var mapPanel_wea = new GeoExt.MapPanel({
title:'WEA',
map: map_wea,
extent: extent,
numZoomLevels: 5,
layers: [mapnik,layer_wea],
items:[]
});
var mapPanel_biogas = new GeoExt.MapPanel({
title:'Biogas',
map: map_biogas,
extent: extent,
numZoomLevels: 5,
layers: [mapnik1, layer_biogas]
});
var mapPanel_wasser = new GeoExt.MapPanel({
title:'Wasserkraft',
map: map_wasser,
extent: extent,
numZoomLevels: 5,
layers: [mapnik2, layer_wasser]
});
var gridContainer = new Ext.Panel({
region:'west',
width:400,
autoHeight:true,
items:[]
});
var centerTabPanel = new Ext.TabPanel({
region:'center',
width: 800,
autoScroll: false,
activeTab: 0,
items:[mapPanel_wea, mapPanel_biogas, mapPanel_wasser],
listeners: {'beforetabchange': function(tabPanel, tab){
var tabname=this.activeTab.titel
switch (tabname)
{
case WEA:
what do it code here?
break;
case Biogas:
what do it code here?
break;
case Wasserkraft:
what do it code here?
break;
}
}
}
});
var viewport = new Ext.Viewport({
layout: "border",
split: true,
items: [gridContainer,centerTabPanel]
});
Cheers for any help!
Rob
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.geoext.org/pipermail/users/attachments/20110404/a5c7e6a8/attachment-0001.htm
More information about the Users
mailing list