[Lada-commits] [PATCH 5 of 7] Used new Editdialog and set the form readonly if the parent probe is readonly

Wald Commits scm-commit at wald.intevation.org
Wed Jul 17 12:16:41 CEST 2013


# HG changeset patch
# User Torsten Irländer <torsten.irlaender at intevation.de>
# Date 1374055768 -7200
# Node ID 6ac95f587e10175e755c731f5300ac5b9206fa81
# Parent  edb2b636319f272e7ff9f023cf13d50005fb1c87
Used new Editdialog and set the form readonly if the parent probe is readonly.

diff -r edb2b636319f -r 6ac95f587e10 app/controller/Messungen.js
--- a/app/controller/Messungen.js	Wed Jul 17 12:09:01 2013 +0200
+++ b/app/controller/Messungen.js	Wed Jul 17 12:09:28 2013 +0200
@@ -1,7 +1,8 @@
 Ext.define('Lada.controller.Messungen', {
     extend: 'Ext.app.Controller',
     views: [
-        'messungen.Create'
+        'messungen.Create',
+        'messungen.Edit'
     ],
     stores: [
         'Proben',
@@ -73,8 +74,11 @@
             }
         });
         var probe = this.getProbenStore().getById(record.get('probeId'));
-        record.set('readonly', probe.get('readonly'));
-        var view = Ext.widget('messungencreate', {model: record});
+        var view = Ext.widget('messungenedit', {model: record});
+        if (probe.get('readonly') === true) {
+            var form = view.down('form');
+            form.setReadOnly(true);
+        }
         console.log("Loaded Messung with ID " + record.getId()); //outputs ID
     },
     deleteMessung: function(button) {


More information about the Lada-commits mailing list