diff app/view/grid/Messwert.js @ 703:9ab7b1eed9f8

Rowediting is now disabled when the Grid was set to ReadOnly
author Dustin Demuth <dustin@intevation.de>
date Fri, 27 Mar 2015 11:03:10 +0100
parents aedf0709af92
children 7f11b75e0188
line wrap: on
line diff
--- a/app/view/grid/Messwert.js	Fri Mar 27 10:20:22 2015 +0100
+++ b/app/view/grid/Messwert.js	Fri Mar 27 11:03:10 2015 +0100
@@ -32,12 +32,16 @@
         this.rowEditing = Ext.create('Ext.grid.plugin.RowEditing', {
             clicksToMoveEditor: 1,
             autoCancel: false,
+            disabled: false,
             pluginId: 'rowedit',
             listeners:{
                 // Make row ineditable when readonly is set to true
                 // Normally this would belong into a controller an not the view.
+                // But the RowEditPlugin is not handled there.
                 beforeedit: function(e, o) {
-                    if (o.record.get('readonly') == true) {
+                    var readonlywin = o.grid.up('window').record.get('readonly');
+                    var readonlygrid = o.record.get('readonly');
+                    if (readonlywin == true || readonlygrid == true || this.disabled)  {
                         return false;
                     }
                     return true;

http://lada.wald.intevation.org