diff app/view/window/MessungEdit.js @ 687:aedf0709af92

Applied ReadOnlyParadigm to a Messung Window
author Dustin Demuth <dustin@intevation.de>
date Wed, 25 Mar 2015 15:45:33 +0100
parents 71e8b84d7829
children 6a6d1b02a1a3
line wrap: on
line diff
--- a/app/view/window/MessungEdit.js	Wed Mar 25 15:20:45 2015 +0100
+++ b/app/view/window/MessungEdit.js	Wed Mar 25 15:45:33 2015 +0100
@@ -103,6 +103,23 @@
             },
             scope: this
         });
+
+        if (this.record.get('readonly') == true){
+            this.down('messungform').setReadOnly(true);
+            this.disableChildren();
+        }
+     },
+
+    disableChildren: function(){
+            this.down('fset[name=messwerte]').down('messwertgrid').setReadOnly(true);
+            this.down('fset[name=messungstatus]').down('statusgrid').setReadOnly(true);
+            this.down('fset[name=messungskommentare]').down('mkommentargrid').setReadOnly(true);
+    },
+
+    enableChildren: function(){
+            this.down('fset[name=messwerte]').down('messwertgrid').setReadOnly(false);
+            this.down('fset[name=messungstatus]').down('statusgrid').setReadOnly(false);
+            this.down('fset[name=messungskommentare]').down('mkommentargrid').setReadOnly(false);
     },
 
     setMessages: function(errors, warnings) {

http://lada.wald.intevation.org