[Commits] r2675 - sandbox/mapgears/geoext.ux/ux/WFSTFeatureEditing/lib/GeoExt.ux/widgets

commits at geoext.org commits at geoext.org
Wed May 11 19:45:17 CEST 2011


Author: adube
Date: 2011-05-11 19:45:17 +0200 (Wed, 11 May 2011)
New Revision: 2675

Modified:
   sandbox/mapgears/geoext.ux/ux/WFSTFeatureEditing/lib/GeoExt.ux/widgets/WFSTFeatureEditingManager.js
Log:
WFSTFeatureEditing - focus on first attribute upon editing start

Modified: sandbox/mapgears/geoext.ux/ux/WFSTFeatureEditing/lib/GeoExt.ux/widgets/WFSTFeatureEditingManager.js
===================================================================
--- sandbox/mapgears/geoext.ux/ux/WFSTFeatureEditing/lib/GeoExt.ux/widgets/WFSTFeatureEditingManager.js	2011-05-11 15:32:16 UTC (rev 2674)
+++ sandbox/mapgears/geoext.ux/ux/WFSTFeatureEditing/lib/GeoExt.ux/widgets/WFSTFeatureEditingManager.js	2011-05-11 17:45:17 UTC (rev 2675)
@@ -548,10 +548,9 @@
     },
 
     getNewFeatureEditorGrid: function(feature, layer) {
-        var store = this.getNewAttributeStore(feature);
-        return new GeoExt.ux.FeatureEditorGrid({
+        var featureEditorGrid = new GeoExt.ux.FeatureEditorGrid({
             nameField: "name",
-            store: store,
+            store: this.getNewAttributeStore(feature),
             feature: feature,
             forceValidation: true,
             allowSave: true,
@@ -570,7 +569,13 @@
                 },
                 scope: {"manager": this, "layer": layer}
             }
-        }); // end of return
+        });
+        // focus (start editing) on first attribute cell when store has loaded
+        //     new records
+        featureEditorGrid.store.on("load", function(store, records, options) {
+            this.editor.getStore().getCount() && this.editor.startEditing(0,1);
+        }, {"editor": featureEditorGrid, "manager": this});
+        return featureEditorGrid;
     },
 
     getNewAttributeStore: function(feature) {



More information about the Commits mailing list