changeset 232:6ac95f587e10

Used new Editdialog and set the form readonly if the parent probe is readonly.
author Torsten Irländer <torsten.irlaender@intevation.de>
date Wed, 17 Jul 2013 12:09:28 +0200
parents edb2b636319f
children f60472df54e3
files app/controller/Messungen.js
diffstat 1 files changed, 7 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- 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) {

http://lada.wald.intevation.org