[Commits] r2213 - in sandbox/camptocamp/extensions/geoext.ux/ux/FeatureBrowser: examples lib/GeoExt.ux

commits at geoext.org commits at geoext.org
Wed May 26 12:22:24 CEST 2010


Author: pgiraud
Date: 2010-05-26 12:22:24 +0200 (Wed, 26 May 2010)
New Revision: 2213

Modified:
   sandbox/camptocamp/extensions/geoext.ux/ux/FeatureBrowser/examples/featurebrowser.js
   sandbox/camptocamp/extensions/geoext.ux/ux/FeatureBrowser/lib/GeoExt.ux/FeatureBrowser.js
Log:
single feature example, and fix for counter update when there's only one feature

Modified: sandbox/camptocamp/extensions/geoext.ux/ux/FeatureBrowser/examples/featurebrowser.js
===================================================================
--- sandbox/camptocamp/extensions/geoext.ux/ux/FeatureBrowser/examples/featurebrowser.js	2010-05-26 10:16:28 UTC (rev 2212)
+++ sandbox/camptocamp/extensions/geoext.ux/ux/FeatureBrowser/examples/featurebrowser.js	2010-05-26 10:22:24 UTC (rev 2213)
@@ -41,4 +41,12 @@
         },
         bodyStyle: "padding: 5px;"
     });
+    var browser = new GeoExt.ux.FeatureBrowser({
+        title: 'Feature Browser - single feature',
+        renderTo: Ext.getBody(),
+        width: 200,
+        height: 200,
+        features: [features[0]],
+        bodyStyle: "padding: 5px;"
+    });
 });

Modified: sandbox/camptocamp/extensions/geoext.ux/ux/FeatureBrowser/lib/GeoExt.ux/FeatureBrowser.js
===================================================================
--- sandbox/camptocamp/extensions/geoext.ux/ux/FeatureBrowser/lib/GeoExt.ux/FeatureBrowser.js	2010-05-26 10:16:28 UTC (rev 2212)
+++ sandbox/camptocamp/extensions/geoext.ux/ux/FeatureBrowser/lib/GeoExt.ux/FeatureBrowser.js	2010-05-26 10:22:24 UTC (rev 2213)
@@ -132,7 +132,9 @@
             'featureselected'
         );
         this.fireEvent('featureselected', this, this.features[0]);
-        Ext.getCmp('counter-' + this.id).setText(
+
+        var counter = Ext.getCmp('counter-' + this.id);
+        counter && counter.setText(
             String.format(this.counterText, 1, nbFeatures)
         );
     },
@@ -149,7 +151,9 @@
         this.fireEvent('featureselected', this, features[next]);
         Ext.getCmp('move-prev' + this.id).setDisabled(next===0);
         Ext.getCmp('move-next' + this.id).setDisabled(next==total - 1);
-        Ext.getCmp('counter-' + this.id).setText(
+
+        var counter = Ext.getCmp('counter-' + this.id);
+        counter && counter.setText(
             String.format(this.counterText, next + 1, total)
         );
     },



More information about the Commits mailing list