[Users] changing grids in a tabpanel: grids only displayed once
Robert Buckley
robertdbuckley at yahoo.com
Tue Apr 5 09:43:21 CEST 2011
Hi,
I have managed to set up a viewport containing 3 mapPanels which are contained
in a tab panel.
With the code below I can start the application and the grids are loaded
according to which tab is activated. The problem is that I can only do it once!
If I change from from the first tab to the second tab....and then back to the
first tab, the grid in is not activated!?!?
I´m sure there is a simple explanation...i hope.
Can anyone see it?
The app is here...
http://maps.zgb.de:8080/geoserver/www/testing/wea_tabs.html
var centerTabPanel = new Ext.TabPanel({
id:'centerTabPanel',
region:'center',
width: 800,
activeTab: 0,
items:[mapPanel_wea, mapPanel_biogas, mapPanel_wasser]
});
centerTabPanel.items.each(function(tab){
tab.on('activate',function(panel){
if
(panel.id == 'WEA') {
// Ext.Msg.alert('Panel', panel.id + '" tab?');
gridContainer.remove(grid_wasser);
gridContainer.remove(grid_biogas);
gridContainer.add(grid_wea);
gridContainer.doLayout();
}
else
if (panel.id == 'Biogas') {
// Ext.Msg.alert('Panel', panel.id + '" tab?');
gridContainer.remove(grid_wea);
gridContainer.remove(grid_wasser);
gridContainer.add(grid_biogas);
gridContainer.doLayout();
}
else
if (panel.id == 'Wasserkraft') {
// Ext.Msg.alert('Panel', panel.id + '" tab?');
gridContainer.remove(grid_wea);
gridContainer.remove(grid_biogas);
gridContainer.add(grid_wasser);
gridContainer.doLayout();
}
});
});
Thanks for any help,
Robert
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.geoext.org/pipermail/users/attachments/20110405/df16a4f3/attachment.htm
More information about the Users
mailing list