diff app/view/grid/Status.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 69cb367c0a63
children ad24af3fcf89
line wrap: on
line diff
--- a/app/view/grid/Status.js	Fri Mar 27 10:20:22 2015 +0100
+++ b/app/view/grid/Status.js	Fri Mar 27 11:03:10 2015 +0100
@@ -26,12 +26,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