diff app/view/grid/Messwert.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 612f4f933083
children aedf0709af92
line wrap: on
line diff
--- a/app/view/grid/Messwert.js	Wed Mar 25 09:07:20 2015 +0100
+++ b/app/view/grid/Messwert.js	Wed Mar 25 15:04:45 2015 +0100
@@ -32,6 +32,7 @@
         this.rowEditing = Ext.create('Ext.grid.plugin.RowEditing', {
             clicksToMoveEditor: 1,
             autoCancel: false,
+            pluginId: 'rowedit',
             listeners:{
                 // Make row ineditable when readonly is set to true
                 // Normally this would belong into a controller an not the view.
@@ -163,5 +164,18 @@
                 messungsId: this.recordId
             }
         });
+    },
+
+    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
+        }
     }
 });

http://lada.wald.intevation.org