changeset 1211:85b018980347

Let each instance of a DayOfYear-widget have its own store. This prevents filtering of comboboxes affecting each other.
author Tom Gottfried <tom@intevation.de>
date Tue, 11 Oct 2016 17:40:37 +0200
parents a24de34d6423
children 3e6756b0fc97
files app/view/widget/DayOfYear.js
diffstat 1 files changed, 41 insertions(+), 41 deletions(-) [+]
line wrap: on
line diff
--- 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.

http://lada.wald.intevation.org