[Commits] r1737 - in sandbox/cmoullet/ux/ScaleSelectorCombo: examples ux/widgets/form

commits at geoext.org commits at geoext.org
Wed Jan 13 11:00:55 CET 2010


Author: cmoullet
Date: 2010-01-13 11:00:55 +0100 (Wed, 13 Jan 2010)
New Revision: 1737

Modified:
   sandbox/cmoullet/ux/ScaleSelectorCombo/examples/ScaleSelectorComboExample.js
   sandbox/cmoullet/ux/ScaleSelectorCombo/ux/widgets/form/ScaleSelectorCombo.js
Log:
Support optionnaly fake values

Modified: sandbox/cmoullet/ux/ScaleSelectorCombo/examples/ScaleSelectorComboExample.js
===================================================================
--- sandbox/cmoullet/ux/ScaleSelectorCombo/examples/ScaleSelectorComboExample.js	2010-01-13 09:41:58 UTC (rev 1736)
+++ sandbox/cmoullet/ux/ScaleSelectorCombo/examples/ScaleSelectorComboExample.js	2010-01-13 10:00:55 UTC (rev 1737)
@@ -22,7 +22,8 @@
     map.addControl(new OpenLayers.Control.MousePosition());
 
     var scaleSelectorCombo = new GeoExt.ux.form.ScaleSelectorCombo({
-        map: map
+        map: map,
+        fakeScaleValue: ['1000','1500','2500','5000','10000','25000','50000','100000','200000','450000','850000','1500000','2500000','5000000','10000000','5000000','100000000','200000000','400000000',]
     });
 
     new GeoExt.ux.form.ScaleSelectorCombo({

Modified: sandbox/cmoullet/ux/ScaleSelectorCombo/ux/widgets/form/ScaleSelectorCombo.js
===================================================================
--- sandbox/cmoullet/ux/ScaleSelectorCombo/ux/widgets/form/ScaleSelectorCombo.js	2010-01-13 09:41:58 UTC (rev 1736)
+++ sandbox/cmoullet/ux/ScaleSelectorCombo/ux/widgets/form/ScaleSelectorCombo.js	2010-01-13 10:00:55 UTC (rev 1737)
@@ -61,6 +61,14 @@
      */
     decimalNumber: 0,
 
+    /** api: config[fakeScaleValue]
+     *  Array of fake scale value
+     */
+    /** private: property[fakeScaleValue]
+     *  Array of fake scale value
+     */
+    fakeScaleValue: null,
+
     /** private: constructor
      */
     initComponent: function() {
@@ -73,7 +81,11 @@
         }
 
         for (var i = 0; i < this.store.getCount(); i++) {
-            this.store.getAt(i).data.formattedScale = this.addThousandSeparator(this.roundNumber(this.store.getAt(i).data.scale, this.decimalNumber), this.thousandSeparator);
+            if (this.fakeScaleValue) {
+               this.store.getAt(i).data.formattedScale = this.addThousandSeparator(this.roundNumber(this.fakeScaleValue[i], this.decimalNumber), this.thousandSeparator);
+            } else {
+               this.store.getAt(i).data.formattedScale = this.addThousandSeparator(this.roundNumber(this.store.getAt(i).data.scale, this.decimalNumber), this.thousandSeparator);
+            }
         }
         this.on('select',
                 function(combo, record, index) {



More information about the Commits mailing list