Mercurial > lada > lada-client
comparison app/view/grid/Probenzusatzwert.js @ 683:612f4f933083
Made Grid-Rows uneditable if the dataset contains readonly=true. This only affects the Grids using the RowEdit Plugin
author | Dustin Demuth <dustin@intevation.de> |
---|---|
date | Wed, 25 Mar 2015 09:07:20 +0100 |
parents | 4a9bd2664da6 |
children | 69cb367c0a63 |
comparison
equal
deleted
inserted
replaced
682:7b6467edfdfc | 683:612f4f933083 |
---|---|
27 recordId: null, | 27 recordId: null, |
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 listeners:{ | |
34 // Make row ineditable when readonly is set to true | |
35 // Normally this would belong into a controller an not the view. | |
36 beforeedit: function(e, o) { | |
37 if (o.record.get('readonly') == true) { | |
38 return false; | |
39 } | |
40 return true; | |
41 } | |
42 } | |
33 }); | 43 }); |
34 this.plugins = [this.rowEditing]; | 44 this.plugins = [this.rowEditing]; |
35 this.dockedItems = [{ | 45 this.dockedItems = [{ |
36 xtype: 'toolbar', | 46 xtype: 'toolbar', |
37 dock: 'bottom', | 47 dock: 'bottom', |