diff app/view/window/ProbeEdit.js @ 684:69cb367c0a63

When a Probeform is dirty, all child-grids are made readonly (Row Editing is not disbled correctly). When a Probe is read-only all Child-grid buttons are disabled. When a Probe is ReadOnly probeform is also readonly.
author Dustin Demuth <dustin@intevation.de>
date Wed, 25 Mar 2015 15:04:45 +0100
parents f373446325b4
children 6a6d1b02a1a3
line wrap: on
line diff
--- a/app/view/window/ProbeEdit.js	Wed Mar 25 09:07:20 2015 +0100
+++ b/app/view/window/ProbeEdit.js	Wed Mar 25 15:04:45 2015 +0100
@@ -53,8 +53,7 @@
             autoScroll: true,
             items: [{
                 xtype: 'probeform',
-                recordId: this.record.get('id'),
-                readonly: this.record.get('readonly')
+                recordId: this.record.get('id')
              }, {
                 xtype: 'fset',
                 name: 'messungen',
@@ -79,7 +78,7 @@
                 }]
             }, {
                 xtype: 'fset',
-                name: 'probenzusaetzwerte',
+                name: 'probenzusatzwerte',
                 title: 'Zusatzwerte',
                 padding: '5, 5',
                 margin: 5,
@@ -121,6 +120,24 @@
             },
             scope: this
         });
+        if (this.record.get('readonly') == true){
+            this.down('probeform').setReadOnly(true);
+            this.disableChildren();
+        }
+    },
+
+    disableChildren: function(){
+            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);
+    },
+
+    enableChildren: function(){
+            this.down('fset[name=messungen]').down('messunggrid').setReadOnly(false);
+            this.down('fset[name=orte]').down('ortgrid').setReadOnly(false);
+            this.down('fset[name=probenzusatzwerte]').down('probenzusatzwertgrid').setReadOnly(false);
+            this.down('fset[name=pkommentare]').down('pkommentargrid').setReadOnly(false);
     },
 
     setMessages: function(errors, warnings) {

http://lada.wald.intevation.org