changeset 799:ad24af3fcf89

created StatusWerte Store to correctly display textual representation of a Status in a MessungenGrid
author Dustin Demuth <dustin@intevation.de>
date Thu, 21 May 2015 15:54:25 +0200
parents ff4330d4aba1
children 4b9b1d3ad9f1
files app/store/StatusWerte.js app/view/grid/Messung.js app/view/grid/Status.js
diffstat 3 files changed, 31 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- /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
+        }]
+});
--- 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);
         }
     },
 
--- 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',

http://lada.wald.intevation.org