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