changeset 707:c632c7c34029

added disable/enableChildren Method
author Dustin Demuth <dustin@intevation.de>
date Fri, 27 Mar 2015 15:22:32 +0100
parents 3e4be37e3e46
children 2ad36c8db968
files app/view/window/MessungCreate.js app/view/window/MessungEdit.js app/view/window/ProbeCreate.js app/view/window/ProbeEdit.js
diffstat 4 files changed, 27 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/app/view/window/MessungCreate.js	Fri Mar 27 14:48:42 2015 +0100
+++ b/app/view/window/MessungCreate.js	Fri Mar 27 15:22:32 2015 +0100
@@ -59,6 +59,15 @@
     },
     clearMessages: function() {
         //todo this is a stub
+    },
+
+    disableChildren: function(){
+        //intentionally!
+        return true;
+    },
+
+    enableChildren: function(){
+        //intentionally!
+        return true;
     }
-
 });
--- a/app/view/window/MessungEdit.js	Fri Mar 27 14:48:42 2015 +0100
+++ b/app/view/window/MessungEdit.js	Fri Mar 27 15:22:32 2015 +0100
@@ -165,10 +165,10 @@
     },
 
     setMessages: function(errors, warnings) {
-        //todo this is a stub
+        this.down('messungform').setMessages(errors, warnings);
     },
     clearMessages: function() {
-        //todo this is a stub
+        this.down('messungform').clearMessages();
     }
 
 });
--- a/app/view/window/ProbeCreate.js	Fri Mar 27 14:48:42 2015 +0100
+++ b/app/view/window/ProbeCreate.js	Fri Mar 27 15:22:32 2015 +0100
@@ -59,5 +59,15 @@
 
     clearMessages: function() {
         this.down('probeform').clearMessages();
+    },
+
+    disableChildren: function(){
+        //intentionally!
+        return true;
+    },
+
+    enableChildren: function(){
+        //intentionally!
+        return true;
     }
 });
--- a/app/view/window/ProbeEdit.js	Fri Mar 27 14:48:42 2015 +0100
+++ b/app/view/window/ProbeEdit.js	Fri Mar 27 15:22:32 2015 +0100
@@ -146,7 +146,11 @@
     },
 
     disableChildren: function(){
-        this.down('fset[name=messungen]').down('messunggrid').setReadOnly(true);
+        if (!this.record.get('owner')) {
+            // Disable only when the User is not the owner of the Probe
+            // Works in symbiosis with success callback some lines above.
+            this.down('fset[name=messungen]').down('messunggrid').setReadOnly(true);
+        }
         this.down('fset[name=orte]').down('ortgrid').setReadOnly(true);
         this.down('fset[name=probenzusatzwerte]').down('probenzusatzwertgrid').setReadOnly(true);
         this.down('fset[name=pkommentare]').down('pkommentargrid').setReadOnly(true);

http://lada.wald.intevation.org