[Commits] r1387 - apps/opengeo/geoexplorer/trunk/src/script/app

commits at geoext.org commits at geoext.org
Thu Oct 8 01:18:35 CEST 2009


Author: tschaub
Date: 2009-10-08 01:18:35 +0200 (Thu, 08 Oct 2009)
New Revision: 1387

Modified:
   apps/opengeo/geoexplorer/trunk/src/script/app/GeoExplorer.js
Log:
The store.find method is silly.  It matches the first record with a value that *starts with* the provided string.  In 3.0 store.findExact should be used.  In 2.x regexes should be provided or findBy should be used.

Modified: apps/opengeo/geoexplorer/trunk/src/script/app/GeoExplorer.js
===================================================================
--- apps/opengeo/geoexplorer/trunk/src/script/app/GeoExplorer.js	2009-10-07 22:54:11 UTC (rev 1386)
+++ apps/opengeo/geoexplorer/trunk/src/script/app/GeoExplorer.js	2009-10-07 23:18:35 UTC (rev 1387)
@@ -533,7 +533,9 @@
             
             for(var i = 0; i < mapConfig.layers.length; ++i) {
                 var conf = mapConfig.layers[i];
-                var index = this.layerSources.find("identifier", conf.wms);
+                var index = this.layerSources.findBy(function(r) {
+                    return r.get("identifier") === conf.wms;
+                });
                 
                 if (index == -1) {
                     continue;
@@ -542,7 +544,9 @@
                 var storeRecord = this.layerSources.getAt(index);
                 var store = storeRecord.data.store;
 
-                var id = store.find("name", conf.name);
+                var id = store.findBy(function(r) {
+                    return r.get("name") === conf.name;
+                });
                 
                 var record;
                 var base;



More information about the Commits mailing list