comparison app/view/grid/Messwert.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 7ede89336dbe
children 69cb367c0a63
comparison
equal deleted inserted replaced
682:7b6467edfdfc 683:612f4f933083
29 recordId: null, 29 recordId: null,
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 }); 35 listeners:{
36 // Make row ineditable when readonly is set to true
37 // Normally this would belong into a controller an not the view.
38 beforeedit: function(e, o) {
39 if (o.record.get('readonly') == true) {
40 return false;
41 }
42 return true;
43 }
44 }
45 });
36 46
37 this.plugins = [this.rowEditing]; 47 this.plugins = [this.rowEditing];
38 48
39 this.dockedItems = [{ 49 this.dockedItems = [{
40 xtype: 'toolbar', 50 xtype: 'toolbar',

http://lada.wald.intevation.org