comparison app/view/grid/PKommentar.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 2c8aa09402a2
children 69cb367c0a63
comparison
equal deleted inserted replaced
682:7b6467edfdfc 683:612f4f933083
28 recordId: null, 28 recordId: null,
29 29
30 initComponent: function() { 30 initComponent: function() {
31 this.rowEditing = Ext.create('Ext.grid.plugin.RowEditing', { 31 this.rowEditing = Ext.create('Ext.grid.plugin.RowEditing', {
32 clicksToMoveEditor: 1, 32 clicksToMoveEditor: 1,
33 autoCancel: false 33 autoCancel: false,
34 }); 34 listeners:{
35 // Make row ineditable when readonly is set to true
36 // Normally this would belong into a controller an not the view.
37 beforeedit: function(e, o) {
38 if (o.record.get('readonly') == true) {
39 return false;
40 }
41 return true;
42 }
43 }
44 });
35 this.plugins = [this.rowEditing]; 45 this.plugins = [this.rowEditing];
36 this.dockedItems = [{ 46 this.dockedItems = [{
37 xtype: 'toolbar', 47 xtype: 'toolbar',
38 dock: 'bottom', 48 dock: 'bottom',
39 items: ['->', { 49 items: ['->', {

http://lada.wald.intevation.org