[Commits] r311 - apps/opengeo/geoexplorer/trunk/lib

commits at geoext.org commits at geoext.org
Wed Apr 1 19:05:55 CEST 2009


Author: sbenthall
Date: 2009-04-01 19:05:55 +0200 (Wed, 01 Apr 2009)
New Revision: 311

Modified:
   apps/opengeo/geoexplorer/trunk/lib/GeoExplorer.js
Log:
capabilities grid window now persists and is shown/hidden instead of created 
and destroyed.  the WMSCapabilitiesStore is now created by the 
CapabilitiesGrid itself.


Modified: apps/opengeo/geoexplorer/trunk/lib/GeoExplorer.js
===================================================================
--- apps/opengeo/geoexplorer/trunk/lib/GeoExplorer.js	2009-04-01 16:53:08 UTC (rev 310)
+++ apps/opengeo/geoexplorer/trunk/lib/GeoExplorer.js	2009-04-01 17:05:55 UTC (rev 311)
@@ -50,6 +50,13 @@
     mapPanel: null,
 
     /**
+     * Property: capGrid
+     * {<Ext.Window>} A window which includes a CapabilitiesGrid panel.
+     */
+    capGrid: null,
+
+
+    /**
      * Property: load
      * Called at the end of construction.  This initiates the sequence that
      *     prepares the application for use.
@@ -69,7 +76,6 @@
         
         // create the layers store
         this.initLayers();
-        this.initWMSStore();
 
         var toolbarItems = this.initMapControlsAndToolbar();
         
@@ -85,6 +91,8 @@
             zoom: mapConfig.zoom
         });
 
+        this.initCapabilitiesGrid();
+
         var layersContainer = new Ext.Panel({
             autoScroll: true,
             title: "Layers",
@@ -202,37 +210,35 @@
         this.layers.add(records);
     },
 
-    initWMSStore: function(){
-        this.wmsStore =  new GeoExt.data.WMSCapabilitiesStore({
-            url: this.ows + "?service=wms&request=GetCapabilities"
-        });
+    initCapabilitiesGrid: function(){
 
-        this.wmsStore.load();
-    },
+        var capGridPanel = new CapabilitiesGrid({
+            url : this.ows,
+            mapPanel : this.mapPanel,
+            height: 300,
+            width: 650
+        })
 
-    showCapabilitiesGrid: function(){
-
-        var win = new Ext.Window({
+        this.capGrid = new Ext.Window({
             title: "Available Layers",
+            closeAction: 'hide',
             items: [
-                new CapabilitiesGrid({
-                    store : this.wmsStore,
-                    mapPanel : this.mapPanel,
-                    height: 300,
-                    width: 650
-                })
+                capGridPanel
             ],
             bbar: ["->",
                    new Ext.Button({
                        text: "Done",
                        handler: function() {
-                           win.close();
-                       }
+                           this.capGrid.hide();
+                       },
+                       scope: this
                    })
                   ]
         });
+    },
 
-        win.show();
+    showCapabilitiesGrid: function(){
+        this.capGrid.show();
     },
 
     initMapControlsAndToolbar: function() {



More information about the Commits mailing list