[Commits] r1749 - core/trunk/geoext/lib/GeoExt/data

commits at geoext.org commits at geoext.org
Thu Jan 14 22:28:40 CET 2010


Author: tschaub
Date: 2010-01-14 22:28:40 +0100 (Thu, 14 Jan 2010)
New Revision: 1749

Modified:
   core/trunk/geoext/lib/GeoExt/data/LayerStore.js
Log:
In the store update listener, only set the layer name if the record title has been set.  r=ahocevar (closes #198)

Modified: core/trunk/geoext/lib/GeoExt/data/LayerStore.js
===================================================================
--- core/trunk/geoext/lib/GeoExt/data/LayerStore.js	2010-01-14 21:12:15 UTC (rev 1748)
+++ core/trunk/geoext/lib/GeoExt/data/LayerStore.js	2010-01-14 21:28:40 UTC (rev 1749)
@@ -347,10 +347,12 @@
          */
         onUpdate: function(store, record, operation) {
             if(operation === Ext.data.Record.EDIT) {
-                var layer = record.get("layer");
-                var title = record.get("title");
-                if(title !== layer.name) {
-                    layer.setName(title);
+                if (record.modified && record.modified.title) {
+                    var layer = record.get("layer");
+                    var title = record.get("title");
+                    if(title !== layer.name) {
+                        layer.setName(title);
+                    }
                 }
             }
         },



More information about the Commits mailing list