Mercurial > lada > lada-client
comparison app/view/grid/MKommentar.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 | 6fe3cef53e74 |
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 this.dockedItems = [{ | 41 this.dockedItems = [{ |
32 xtype: 'toolbar', | 42 xtype: 'toolbar', |
33 dock: 'bottom', | 43 dock: 'bottom', |
34 items: ['->', { | 44 items: ['->', { |