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