changeset 143:62b757ccdd8f

Show Messeinheit next to the Messwert field and change the value if the Probenzusatz changes.
author Torsten Irländer <torsten.irlaender@intevation.de>
date Fri, 28 Jun 2013 11:16:44 +0200
parents dee9da79f055
children 7b1140bd8b3d
files app/view/zusatzwerte/CreateForm.js
diffstat 1 files changed, 27 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/app/view/zusatzwerte/CreateForm.js	Fri Jun 28 11:15:39 2013 +0200
+++ b/app/view/zusatzwerte/CreateForm.js	Fri Jun 28 11:16:44 2013 +0200
@@ -9,12 +9,34 @@
             {
                 xtype: 'probenzusatzwert',
                 name: 'pzsId',
-                fieldLabel: 'PZW-Größe'
+                fieldLabel: 'PZW-Größe',
+                listeners: {
+                    scope: this,
+                    'change': function (field, newv, oldv, opts) {
+                        console.log(field, oldv, newv, opts);
+                        var ffield = this.getForm().findField("messeinheit");
+                        pzsId = newv;
+                        if (pzsId == undefined) {
+                            pzsId = oldv;
+                        }
+                        ffield.setValue(this.model.getMesseinheit(pzsId));
+                    }
+                }
             },
             {
-                xtype: 'textfield',
-                name: 'messwertPzs',
-                fieldLabel: 'Messwert'
+                layout: "column",
+                border: 0,
+                items: [
+                    {
+                        xtype: 'textfield',
+                        name: 'messwertPzs',
+                        fieldLabel: 'Messwert'
+                    },
+                    {
+                        xtype: 'displayfield',
+                        name: 'messeinheit'
+                    }
+                ]
             },
             {
                 xtype: 'textfield',
@@ -30,3 +52,4 @@
         this.callParent();
     }
 });
+

http://lada.wald.intevation.org