diff app/view/grid/Messung.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 6742ae5f35dc
children ad24af3fcf89
line wrap: on
line diff
--- a/app/view/grid/Messung.js	Wed Mar 25 09:07:20 2015 +0100
+++ b/app/view/grid/Messung.js	Wed Mar 25 15:04:45 2015 +0100
@@ -195,5 +195,23 @@
         if (Ext.fly(opts.divId)) {
             Ext.fly(opts.divId).update(value);
         }
+    },
+
+    setReadOnly: function(b) {
+        if (b == true){
+            //Readonly
+            if (this.getPlugin('rowedit')){
+                this.getPlugin('rowedit').disable();
+            }
+            this.down('button[action=delete]').disable();
+            this.down('button[action=add]').disable();
+        }else{
+            //Writable
+            if (this.getPlugin('rowedit')){
+                this.getPlugin('rowedit').enable();
+            }
+            this.down('button[action=delete]').enable();
+            this.down('button[action=add]').enable();
+        }
     }
 });

http://lada.wald.intevation.org