<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content=text/html;charset=iso-8859-1>
<STYLE type=text/css><!-- DIV {margin:0px;} --></STYLE>
<META content="MSHTML 6.00.6002.18357" name=GENERATOR></HEAD>
<BODY id=MailContainerBody
style="PADDING-RIGHT: 10px; PADDING-LEFT: 10px; PADDING-TOP: 15px" leftMargin=0
topMargin=0 CanvasTabStop="true" name="Compose message area">
<DIV><FONT face=Arial size=2>the remove function can take 2 arguments. The 1st
is the component to remove, the 2nd is the autoDestroy flag. If not specified it
defaults to the container's autoDestroy value, which defaults to true for
Ext.Panel</FONT></DIV>
<DIV><FONT face=Arial size=2>So when you remove the grids from the grid
container you are destroying them and they are not available for further
use.</FONT></DIV>
<DIV><FONT face=Arial size=2>You need to either set the 'autoDestroy' config
property of the grid container panel to false or else specify the 2nd parameter
as false in the remove function calls.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Matt Priour</FONT></DIV>
<DIV style="FONT: 10pt Tahoma">
<DIV><BR></DIV>
<DIV style="BACKGROUND: #f5f5f5">
<DIV style="font-color: black"><B>From:</B> <A title=robertdbuckley@yahoo.com
href="mailto:robertdbuckley@yahoo.com">Robert Buckley</A> </DIV>
<DIV><B>Sent:</B> Tuesday, April 05, 2011 2:43 AM</DIV>
<DIV><B>To:</B> <A title=users@geoext.org
href="mailto:users@geoext.org">users@geoext.org</A> </DIV>
<DIV><B>Subject:</B> [Users] changing grids in a tabpanel: grids only displayed
once</DIV></DIV></DIV>
<DIV><BR></DIV>
<DIV
style="FONT-SIZE: 10pt; COLOR: #40007f; FONT-FAMILY: arial,helvetica,sans-serif">Hi,<BR><BR>I
have managed to set up a viewport containing 3 mapPanels which are contained in
a tab panel.<BR><BR>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! <BR>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!?!?<BR><BR>I´m sure there is a simple explanation...i hope. <BR>Can
anyone see it?<BR><BR>The app is here...<BR><A
href="http://maps.zgb.de:8080/geoserver/www/testing/wea_tabs.html">http://maps.zgb.de:8080/geoserver/www/testing/wea_tabs.html</A><BR><BR><BR>
var centerTabPanel = new Ext.TabPanel({<BR>
id:'centerTabPanel',<BR>
region:'center',<BR>
width: 800, <BR>
activeTab: 0,<BR>
items:[mapPanel_wea, mapPanel_biogas, mapPanel_wasser]<BR>
});<BR>
<BR>
centerTabPanel.items.each(function(tab){<BR>
<BR>
tab.on('activate',function(panel){<BR>
if<BR>
(panel.id == 'WEA')
{<BR>
//
Ext.Msg.alert('Panel', panel.id + '" tab?');<BR>
gridContainer.remove(grid_wasser);<BR>
gridContainer.remove(grid_biogas);<BR>
gridContainer.add(grid_wea);<BR>
gridContainer.doLayout();<BR>
}<BR>
else<BR>
if (panel.id == 'Biogas') {<BR>
// Ext.Msg.alert('Panel', panel.id +
'" tab?');<BR>
gridContainer.remove(grid_wea);<BR>
gridContainer.remove(grid_wasser);<BR>
gridContainer.add(grid_biogas);<BR>
gridContainer.doLayout();<BR>
}<BR>
else<BR>
if (panel.id == 'Wasserkraft') {<BR>
// Ext.Msg.alert('Panel', panel.id +
'" tab?');<BR>
gridContainer.remove(grid_wea);<BR>
gridContainer.remove(grid_biogas);<BR>
gridContainer.add(grid_wasser);<BR>
gridContainer.doLayout();<BR>
}<BR>
});<BR> <BR>
});
<DIV><BR><BR>Thanks for any help,<BR><BR>Robert<BR></DIV></DIV>
<P>
<HR>
<P></P>_______________________________________________<BR>Users mailing
list<BR>Users@geoext.org<BR>http://www.geoext.org/cgi-bin/mailman/listinfo/users<BR></BODY></HTML>