[Lada-commits] [PATCH 3 of 3] Fix for issue58. Get the related probe for the messwert and check if the probe

Wald Commits scm-commit at wald.intevation.org
Thu Aug 8 15:51:33 CEST 2013


# HG changeset patch
# User Torsten Irländer <torsten.irlaender at intevation.de>
# Date 1375969807 -7200
# Node ID c32be5f97b5d2d08187a289e2d1d29c65aa99a1a
# Parent  dec0893d38e3fe60b583e6a71a95c2ecf5edb85e
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.

diff -r dec0893d38e3 -r c32be5f97b5d app/controller/Messwert.js
--- 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) {


More information about the Lada-commits mailing list