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

http://lada.wald.intevation.org