diff app/controller/Messungen.js @ 362:6a7a9267e00f

Issue56: Changed way how to set the form and window to readonly. Now all dialogs should habe proper readonly settings. Now the Save and Cancel button are displayed as needed.
author Torsten Irländer <torsten.irlaender@intevation.de>
date Thu, 15 Aug 2013 14:07:35 +0200
parents c5b8c0d8aec3
children debfcc7713e3
line wrap: on
line diff
--- a/app/controller/Messungen.js	Thu Aug 15 14:05:08 2013 +0200
+++ b/app/controller/Messungen.js	Thu Aug 15 14:07:35 2013 +0200
@@ -80,18 +80,19 @@
                 messungsId: record.get('messungsId')
             }
         });
-        var probe = this.getProbenStore().getById(record.get('probeId'));
+        record.getAuthInfo(this.initEditWindow);
+        console.log("Loaded Messung with ID " + record.getId()); //outputs ID
+    },
+    initEditWindow: function(record, readonly, owner) {
         var view = Ext.widget('messungenedit', {model: record});
-        if (probe.get('readonly') === true) {
+        var ignore = Array();
+        if (owner) {
+                ignore.push('fertig');
+        }
+        if (readonly) {
             var form = view.down('form');
-            // TODO: Field "fertig" must be editable (issue51). So we need to remove the
-            // readonly status if the user would be allowed to edit the probe
-            // if the "fertig" flag has not been set. (ti) <2013-08-08 10:24> 
-            var ignore = Array();
-            ignore.push('fertig');
             form.setReadOnly(true, ignore);
         }
-        console.log("Loaded Messung with ID " + record.getId()); //outputs ID
     },
     deleteItem: function(button) {
         // Get selected item in grid

http://lada.wald.intevation.org