comparison app/view/grid/Status.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 1c5a4b419149
children 69cb367c0a63
comparison
equal deleted inserted replaced
682:7b6467edfdfc 683:612f4f933083
23 recordId: null, 23 recordId: null,
24 24
25 initComponent: function() { 25 initComponent: function() {
26 this.rowEditing = Ext.create('Ext.grid.plugin.RowEditing', { 26 this.rowEditing = Ext.create('Ext.grid.plugin.RowEditing', {
27 clicksToMoveEditor: 1, 27 clicksToMoveEditor: 1,
28 autoCancel: false 28 autoCancel: false,
29 }); 29 listeners:{
30 // Make row ineditable when readonly is set to true
31 // Normally this would belong into a controller an not the view.
32 beforeedit: function(e, o) {
33 if (o.record.get('readonly') == true) {
34 return false;
35 }
36 return true;
37 }
38 }
39 });
30 this.plugins = [this.rowEditing]; 40 this.plugins = [this.rowEditing];
31 41
32 var statusStore = Ext.create('Ext.data.Store', { 42 var statusStore = Ext.create('Ext.data.Store', {
33 fields: ['display', 'id'], 43 fields: ['display', 'id'],
34 data: [{ 44 data: [{

http://lada.wald.intevation.org