[Commits] r1971 - sandbox/mapgears/geoext.ux/ux/WMSLayerAdder/lib/GeoExt.ux/widgets

commits at geoext.org commits at geoext.org
Tue Mar 16 15:15:26 CET 2010


Author: adube
Date: 2010-03-16 15:15:26 +0100 (Tue, 16 Mar 2010)
New Revision: 1971

Modified:
   sandbox/mapgears/geoext.ux/ux/WMSLayerAdder/lib/GeoExt.ux/widgets/WMSLayerAdder.js
Log:
wmslayeradder - i18n, minor changes

Modified: sandbox/mapgears/geoext.ux/ux/WMSLayerAdder/lib/GeoExt.ux/widgets/WMSLayerAdder.js
===================================================================
--- sandbox/mapgears/geoext.ux/ux/WMSLayerAdder/lib/GeoExt.ux/widgets/WMSLayerAdder.js	2010-03-16 13:56:39 UTC (rev 1970)
+++ sandbox/mapgears/geoext.ux/ux/WMSLayerAdder/lib/GeoExt.ux/widgets/WMSLayerAdder.js	2010-03-16 14:15:26 UTC (rev 1971)
@@ -201,7 +201,7 @@
         var url = Ext.getCmp('wms_url').value;
 
         if(!url) {
-            alert(OpenLayers.i18n('Please, enter an url in the textbox above'));
+            alert(OpenLayers.i18n('Please, enter an url in the textbox'));
             return;
         }
 
@@ -212,11 +212,15 @@
             url = OpenLayers.ProxyHost + encodeURIComponent(url);
         }
 
+        // create a store from the url
         this.createWMSCapabilitiesStore(url);
-        this.removeAllItemsFromObject(Ext.getCmp('wms_capabilities_panel'));
-        Ext.getCmp('wms_capabilities_panel').add(this.createGridPanel());
-        Ext.getCmp('wms_capabilities_panel').add(this.createFormPanel());
-        Ext.getCmp('wms_capabilities_panel').doLayout();
+
+        // remove the grid and form panels from the container and recreate them
+        var panel = Ext.getCmp('wms_capabilities_panel')
+        this.removeAllItemsFromObject(panel);
+        panel.add(this.createGridPanel());
+        panel.add(this.createFormPanel());
+        panel.doLayout();
     },
 
     removeAllItemsFromObject: function(object){
@@ -233,6 +237,16 @@
     },
 
     createGridPanel: function() {
+        var columns = [
+            { header: OpenLayers.i18n('Title'), 
+              dataIndex: "title", id: "title", sortable: true},
+            { header: OpenLayers.i18n('Name'), 
+              dataIndex: "name", sortable: true},
+            { header: OpenLayers.i18n('Queryable'), 
+              dataIndex: "queryable", sortable: true, hidden: true},
+            { header: OpenLayers.i18n('Description'),
+              dataIndex: "abstract", hidden: true}
+        ];
 
         // In order to have a scrollbar, a GridPanel must have a 'height' set,
         // it can't be left with 'autoHeight': true...
@@ -241,12 +255,7 @@
             columnWidth: 0.5,
             layout: 'fit',
             store: this.WMSCapabilitiesStore,
-            columns: [
-                {header: "Title", dataIndex: "title", sortable: true},
-                {header: "Name", dataIndex: "name", sortable: true},
-                {header: "Queryable", dataIndex: "queryable", sortable: true, width: 70, hidden: true},
-                {id: "description", header: "Description", dataIndex: "abstract", hidden: true}
-            ],
+            columns: columns,
             // SelectionModel
             sm: new Ext.grid.RowSelectionModel({
                 singleSelect: true,
@@ -256,7 +265,7 @@
                     }
                 }
             }),
-            autoExpandColumn: "description",
+            autoExpandColumn: "title",
             width: 'auto',
             autoWidth: true,
             //height: 'auto',
@@ -290,17 +299,17 @@
                 "margin-right": Ext.isIE6 ? (Ext.isStrict ? "-10px" : "-13px") : "0"
             },
             items: [{
-                fieldLabel: 'Title',
+                fieldLabel: OpenLayers.i18n('Title'),
                 name: 'title'
             },{
-                fieldLabel: 'Name',
+                fieldLabel: OpenLayers.i18n('Name'),
                 name: 'name'
             },{
-                fieldLabel: 'Queryable',
+                fieldLabel: OpenLayers.i18n('Queryable'),
                 name: 'queryable'
             },{
                 xtype: 'textarea',
-                fieldLabel: 'Abstract',
+                fieldLabel: OpenLayers.i18n('Description'),
                 name: 'abstract',
                 anchor: '100% -15'
             }]
@@ -349,7 +358,7 @@
         var action = new Ext.Action(actionOptions);
         items.push(action);
 
-        // Cancel action... todo
+        // Cancel/Close action... todo
 
 
         Ext.apply(this, {bbar: new Ext.Toolbar(items)});



More information about the Commits mailing list