comparison app/view/grid/MKommentar.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 7f11b75e0188
comparison
equal deleted inserted replaced
702:0c8e689f3bcb 703:9ab7b1eed9f8
24 24
25 initComponent: function() { 25 initComponent: function() {
26 this.rowEditing = Ext.create('Ext.grid.plugin.RowEditing', { 26 this.rowEditing = Ext.create('Ext.grid.plugin.RowEditing', {
27 clicksToMoveEditor: 1, 27 clicksToMoveEditor: 1,
28 autoCancel: false, 28 autoCancel: false,
29 disabled: false,
29 pluginId: 'rowedit', 30 pluginId: 'rowedit',
30 listeners:{ 31 listeners:{
31 // Make row ineditable when readonly is set to true 32 // Make row ineditable when readonly is set to true
32 // Normally this would belong into a controller an not the view. 33 // Normally this would belong into a controller an not the view.
34 // But the RowEditPlugin is not handled there.
33 beforeedit: function(e, o) { 35 beforeedit: function(e, o) {
34 if (o.record.get('readonly') == true) { 36 var readonlywin = o.grid.up('window').record.get('readonly');
37 var readonlygrid = o.record.get('readonly');
38 if (readonlywin == true || readonlygrid == true || this.disabled) {
35 return false; 39 return false;
36 } 40 }
37 return true; 41 return true;
38 } 42 }
39 } 43 }
40 }); 44 });
41 this.plugins = [this.rowEditing]; 45 this.plugins = [this.rowEditing];
42 this.dockedItems = [{ 46 this.dockedItems = [{
43 xtype: 'toolbar', 47 xtype: 'toolbar',
44 dock: 'bottom', 48 dock: 'bottom',
45 items: ['->', { 49 items: ['->', {

http://lada.wald.intevation.org