changeset 444:52d9af2cf6f1

Merged
author Torsten Irländer <torsten.irlaender@intevation.de>
date Tue, 03 Dec 2013 11:29:27 +0100
parents 0ab89a3b9090 (diff) d900db3e9be9 (current diff)
children a122424f2f0f
files
diffstat 4 files changed, 39 insertions(+), 30 deletions(-) [+]
line wrap: on
line diff
--- a/app/model/Messwert.js	Mon Dec 02 15:20:30 2013 +0100
+++ b/app/model/Messwert.js	Tue Dec 03 11:29:27 2013 +0100
@@ -9,6 +9,7 @@
         {name: "probeId", mapping:"id.probeId"},
         {name: "messgroesseId", mapping:"id.messgroesseId"},
         {name: "messwert", type:"float"},
+        {name: "messwertNwg"},
         {name: "messfehler", type:"float"},
         {name: "nwgZuMesswert", type:"float"},
         {name: "mehId"},
--- a/app/view/messwerte/CreateForm.js	Mon Dec 02 15:20:30 2013 +0100
+++ b/app/view/messwerte/CreateForm.js	Tue Dec 03 11:29:27 2013 +0100
@@ -6,7 +6,8 @@
     model: 'Lada.model.Messwert',
     requires: [
         'Lada.view.widgets.Messgroesse',
-        'Lada.view.widgets.Messeinheit'
+        'Lada.view.widgets.Messeinheit',
+        'Lada.view.widgets.Nwg'
     ],
     initComponent: function() {
         this.items = [
@@ -16,6 +17,16 @@
                 fieldLabel: 'Messwert'
             },
             {
+                xtype: 'nwg',
+                name: 'messwertNwg',
+                fieldLabel: 'Messwert zu NWG'
+            },
+            {
+                xtype: 'numberfield',
+                name: 'nwgZuMesswert',
+                fieldLabel: 'Nachweisgrenze'
+            },
+            {
                 xtype: 'numberfield',
                 name: 'messfehler',
                 fieldLabel: 'Messfehler'
@@ -29,11 +40,6 @@
                 xtype: 'messeinheit',
                 name: 'mehId',
                 fieldLabel: 'Messeinheit'
-            },
-            {
-                xtype: 'numberfield',
-                name: 'nwgZuMesswert',
-                fieldLabel: 'Nachweisgrenze'
             }
         ];
         this.callParent();
--- a/app/view/messwerte/List.js	Mon Dec 02 15:20:30 2013 +0100
+++ b/app/view/messwerte/List.js	Tue Dec 03 11:29:27 2013 +0100
@@ -39,33 +39,11 @@
         this.columns = [
             {
                 header: '&lt;NWG',
-                dataIndex: 'messwert',
-                renderer: function(value, row) {
-                    // the seconds argument here is not documented in JQuery
-                    // but it has the current rendererd row and this
-                    // referenced the record.
-                    var nwg = row.record.get('nwgZuMesswert');
-                    if (value < nwg) {
-                        return "<";
-                    } else {
-                        return "";
-                    }
-                }
+                dataIndex: 'messwertNwg'
             },
             {
                 header: 'Messwert',
-                dataIndex: 'messwert',
-                renderer: function(value, row) {
-                    // the seconds argument here is not documented in JQuery
-                    // but it has the current rendererd row and this
-                    // referenced the record.
-                    var nwg = row.record.get('nwgZuMesswert');
-                    if (value < nwg) {
-                        return nwg;
-                    } else {
-                        return value;
-                    }
-                }
+                dataIndex: 'messwert'
             },
             {header: 'Messfehler', dataIndex: 'messfehler'},
             {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/view/widgets/Nwg.js	Tue Dec 03 11:29:27 2013 +0100
@@ -0,0 +1,24 @@
+var nwgStore = Ext.create('Ext.data.Store', {
+    fields: ['nwgId', 'nwg'],
+    data: [
+        {"nwgId":"", "nwg":">="},
+        {"nwgId":"<", "nwg":"<"}
+    ]
+});
+
+/**
+ * Combobox for Nachweisgrenze.
+ */
+Ext.define('Lada.view.widgets.Nwg' ,{
+        extend: 'Ext.form.ComboBox',
+        editable: false,
+        alias: 'widget.nwg',
+        store: nwgStore,
+        queryMode: 'local',
+        displayField:'nwg',
+        valueField: 'nwgId',
+        emptyText:'Messwert kleiner als Nachweisgrenze?',
+    initComponent: function() {
+        this.callParent(arguments);
+    }
+});

http://lada.wald.intevation.org