[Commits] r734 - sandbox/bartvde/legend/geoext/lib/GeoExt/widgets

commits at geoext.org commits at geoext.org
Thu May 14 20:09:27 CEST 2009


Author: bartvde
Date: 2009-05-14 20:09:27 +0200 (Thu, 14 May 2009)
New Revision: 734

Modified:
   sandbox/bartvde/legend/geoext/lib/GeoExt/widgets/LegendPanel.js
Log:
implement static property

Modified: sandbox/bartvde/legend/geoext/lib/GeoExt/widgets/LegendPanel.js
===================================================================
--- sandbox/bartvde/legend/geoext/lib/GeoExt/widgets/LegendPanel.js	2009-05-14 18:02:49 UTC (rev 733)
+++ sandbox/bartvde/legend/geoext/lib/GeoExt/widgets/LegendPanel.js	2009-05-14 18:09:27 UTC (rev 734)
@@ -27,6 +27,14 @@
      *  If false, this is inverted. Default value is true.
      */
     ascending: true,
+
+    /** api: config[static]
+     *  ``Boolean``
+     *  If true the LegendPanel will not listen to the add, remove and change 
+     *  events of the LayerStore. So it will load with the initial state of
+     *  the LayerStore and not change anymore. 
+     */
+    static: false,
     
     /** api: config[showTitle]
      *  ``Boolean``
@@ -71,11 +79,13 @@
             this.layerStore = GeoExt.MapPanel.guess().layers;
         }
         this.layerStore.each(this.addLegend, this);
-        this.layerStore.on({
-            "add": this.onStoreAdd,
-            "remove": this.onStoreRemove,
-            scope: this
-        });
+        if (!this.static) {
+            this.layerStore.on({
+                "add": this.onStoreAdd,
+                "remove": this.onStoreRemove,
+                scope: this
+            });
+        }
         this.doLayout();
     },
 



More information about the Commits mailing list