changeset 284:c32be5f97b5d

Fix for issue58. Get the related probe for the messwert and check if the probe is set readonly. If so set the messwert dialog to readonly true.
author Torsten Irländer <torsten.irlaender@intevation.de>
date Thu, 08 Aug 2013 15:50:07 +0200
parents dec0893d38e3
children 6c030e5739a7
files app/controller/Messwert.js
diffstat 1 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/app/controller/Messwert.js	Thu Aug 08 15:46:28 2013 +0200
+++ b/app/controller/Messwert.js	Thu Aug 08 15:50:07 2013 +0200
@@ -4,6 +4,7 @@
         'messwerte.Create'
     ],
     stores: [
+        'Proben',
         'Messungen',
         'Messwerte',
         'Messeinheit',
@@ -46,7 +47,13 @@
     },
     editMesswert: function(grid, record) {
         console.log('Editing Messwert');
+        var probe = this.getProbenStore().getById(record.get('probeId'));
         var view = Ext.widget('messwertecreate', {model: record});
+        if (probe.get('readonly') === true) {
+            var form = view.down('form');
+            form.setReadOnly(true);
+        }
+
         console.log("Loaded Messwert with ID " + record.getId()); //outputs ID
     },
     deleteMesswert: function(button) {

http://lada.wald.intevation.org