diff app/model/Zusatzwert.js @ 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 4287f29b5b81
children 51897f9a6bbb
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