changeset 142:dee9da79f055

Added function to model with return the beschreibung of the messeinheit of a given Probenzusatzwert by pzsId.
author Torsten Irländer <torsten.irlaender@intevation.de>
date Fri, 28 Jun 2013 11:15:39 +0200
parents 1fb79e16149f
children 62b757ccdd8f
files app/model/Zusatzwert.js
diffstat 1 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/app/model/Zusatzwert.js	Fri Jun 28 09:51:41 2013 +0200
+++ b/app/model/Zusatzwert.js	Fri Jun 28 11:15:39 2013 +0200
@@ -26,6 +26,13 @@
         var pzsId =  this.get('pzsId');
         var probeId = this.get('probeId');
         return "/" + pzsId + "/" + probeId;
+    },
+    getMesseinheit: function(pzsId) {
+        var zstore = Ext.getStore('Probenzusatzwerte');
+        var mstore = Ext.getStore('Messeinheit');
+        var mehId = zstore.getById(pzsId).get('mehId');
+        var record = mstore.findRecord('mehId', mehId);
+        return record.get('einheit');
     }
 });
 

http://lada.wald.intevation.org