[Users] RE load different grid on tabPanel event listener

Steve.Toutant at inspq.qc.ca Steve.Toutant at inspq.qc.ca
Mon Apr 4 21:17:11 CEST 2011


Perhaps use activate event on the tabPanel to update the gridContainer




Robert Buckley <robertdbuckley at yahoo.com>@geoext.org 
Envoyé par : users-bounces at geoext.org
2011-04-04 15:04

A
users at geoext.org
cc

Objet
[Users] load different grid on tabPanel event listener








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_______________________________________________
Users mailing list
Users at geoext.org
http://www.geoext.org/cgi-bin/mailman/listinfo/users



-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.geoext.org/pipermail/users/attachments/20110404/ed9ca9c1/attachment.htm 


More information about the Users mailing list