[Lada-commits] [PATCH 1 of 2] created StatusWerte Store to correctly display textual representation of a Status in a MessungenGrid

Wald Commits scm-commit at wald.intevation.org
Thu May 21 18:01:25 CEST 2015


# HG changeset patch
# User Dustin Demuth <dustin at intevation.de>
# Date 1432216465 -7200
# Node ID ad24af3fcf89edb088bd408d51a5eb94b624f0c9
# Parent  ff4330d4aba13b5c08684383acf1824cda767058
created StatusWerte Store to correctly display textual representation of a Status in a MessungenGrid

diff -r ff4330d4aba1 -r ad24af3fcf89 app/store/StatusWerte.js
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/store/StatusWerte.js	Thu May 21 15:54:25 2015 +0200
@@ -0,0 +1,27 @@
+/* Copyright (C) 2013 by Bundesamt fuer Strahlenschutz
+ * Software engineering by Intevation GmbH
+ *
+ * This file is Free Software under the GNU GPL (v>=3)
+ * and comes with ABSOLUTELY NO WARRANTY! Check out
+ * the documentation coming with IMIS-Labordaten-Application for details.
+ */
+
+/**
+ * Store for Status-Werte
+ * TODO i18n
+ */
+Ext.define('Lada.store.StatusWerte', {
+    extend: 'Ext.data.Store',
+    fields: ['display', 'id'],
+    data: [{
+            display: 'unbekannt', id: 0
+        }, {
+            display: 'nicht vergeben', id: 1
+        }, {
+            display: 'plausibel', id: 2
+        }, {
+            display: 'nicht repräsentativ', id: 3
+        }, {
+            display: 'nicht plausibel', id: 4
+        }]
+});
diff -r ff4330d4aba1 -r ad24af3fcf89 app/view/grid/Messung.js
--- a/app/view/grid/Messung.js	Thu May 21 15:23:49 2015 +0200
+++ b/app/view/grid/Messung.js	Thu May 21 15:54:25 2015 +0200
@@ -193,7 +193,9 @@
             value = sstore.last().get('status');
         }
         if (Ext.fly(opts.divId)) {
-            Ext.fly(opts.divId).update(value);
+            var sta = Ext.create('Lada.store.StatusWerte');
+            var val = sta.getById(value).get('display');
+            Ext.fly(opts.divId).update(val);
         }
     },
 
diff -r ff4330d4aba1 -r ad24af3fcf89 app/view/grid/Status.js
--- a/app/view/grid/Status.js	Thu May 21 15:23:49 2015 +0200
+++ b/app/view/grid/Status.js	Thu May 21 15:54:25 2015 +0200
@@ -44,20 +44,7 @@
          });
         this.plugins = [this.rowEditing];
 
-        var statusStore = Ext.create('Ext.data.Store', {
-            fields: ['display', 'id'],
-            data: [{
-                display: 'unbekannt', id: 0
-            }, {
-                display: 'nicht vergeben', id: 1
-            }, {
-                display: 'plausibel', id: 2
-            }, {
-                display: 'nicht repräsentativ', id: 3
-            }, {
-                display: 'nicht plausibel', id: 4
-            }]
-        });
+        var statusStore = Ext.create('Lada.store.StatusWerte');
         this.dockedItems = [{
             xtype: 'toolbar',
             dock: 'bottom',


More information about the Lada-commits mailing list