[Lada-commits] [PATCH] Let each instance of a DayOfYear-widget have its own store

Wald Commits scm-commit at wald.intevation.org
Tue Oct 11 17:40:50 CEST 2016


# HG changeset patch
# User Tom Gottfried <tom at intevation.de>
# Date 1476200437 -7200
# Node ID 85b018980347909a866389e7dc3619ec82fbcad3
# Parent  a24de34d64239492478aa1b4d07f3fd55b60d19e
Let each instance of a DayOfYear-widget have its own store.

This prevents filtering of comboboxes affecting each other.

diff -r a24de34d6423 -r 85b018980347 app/view/widget/DayOfYear.js
--- a/app/view/widget/DayOfYear.js	Tue Oct 11 14:34:12 2016 +0200
+++ b/app/view/widget/DayOfYear.js	Tue Oct 11 17:40:37 2016 +0200
@@ -6,47 +6,6 @@
  * the documentation coming with IMIS-Labordaten-Application for details.
  */
 
-var monthsStore = Ext.create('Ext.data.Store', {
-    fields: ['id', 'name'],
-    data: [{
-        'id': 0,
-        'name': 'Januar'
-    }, {
-        'id': 1,
-        'name': 'Februar'
-    }, {
-        'id': 2,
-        'name': 'März'
-    }, {
-        'id': 3,
-        'name': 'April'
-    }, {
-        'id': 4,
-        'name': 'Mai'
-    }, {
-        'id': 5,
-        'name': 'Juni'
-    }, {
-        'id': 6,
-        'name': 'Juli'
-    }, {
-        'id': 7,
-        'name': 'August'
-    }, {
-        'id': 8,
-        'name': 'September'
-    }, {
-        'id': 9,
-        'name': 'Oktober'
-    }, {
-        'id': 10,
-        'name': 'November'
-    }, {
-        'id': 11,
-        'name': 'Dezember'
-    }]
-});
-
 /**
  * Panel to select month and day of month,
  * that can be serialized to day of year
@@ -64,6 +23,47 @@
     initComponent: function() {
         var me = this;
 
+        var monthsStore = Ext.create('Ext.data.Store', {
+            fields: ['id', 'name'],
+            data: [{
+                'id': 0,
+                'name': 'Januar'
+            }, {
+                'id': 1,
+                'name': 'Februar'
+            }, {
+                'id': 2,
+                'name': 'März'
+            }, {
+                'id': 3,
+                'name': 'April'
+            }, {
+                'id': 4,
+                'name': 'Mai'
+            }, {
+                'id': 5,
+                'name': 'Juni'
+            }, {
+                'id': 6,
+                'name': 'Juli'
+            }, {
+                'id': 7,
+                'name': 'August'
+            }, {
+                'id': 8,
+                'name': 'September'
+            }, {
+                'id': 9,
+                'name': 'Oktober'
+            }, {
+                'id': 10,
+                'name': 'November'
+            }, {
+                'id': 11,
+                'name': 'Dezember'
+            }]
+        });
+
         /*
          * Create hidden field to hold the day of year value
          * for/of the record of the form.


More information about the Lada-commits mailing list