# HG changeset patch # User Torsten Irländer <torsten.irlaender@intevation.de> # Date 1372411004 -7200 # Node ID 62b757ccdd8fe3a23845ecacc3c04c0c3d891e51 # Parent dee9da79f05560b60e6aa598ad261e302b6db937 Show Messeinheit next to the Messwert field and change the value if the Probenzusatz changes. diff -r dee9da79f055 -r 62b757ccdd8f app/view/zusatzwerte/CreateForm.js --- 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(); } }); +