comparison app/view/grid/Status.js @ 684:69cb367c0a63

When a Probeform is dirty, all child-grids are made readonly (Row Editing is not disbled correctly). When a Probe is read-only all Child-grid buttons are disabled. When a Probe is ReadOnly probeform is also readonly.
author Dustin Demuth <dustin@intevation.de>
date Wed, 25 Mar 2015 15:04:45 +0100
parents 612f4f933083
children 9ab7b1eed9f8
comparison
equal deleted inserted replaced
683:612f4f933083 684:69cb367c0a63
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 pluginId: 'rowedit',
29 listeners:{ 30 listeners:{
30 // Make row ineditable when readonly is set to true 31 // Make row ineditable when readonly is set to true
31 // Normally this would belong into a controller an not the view. 32 // Normally this would belong into a controller an not the view.
32 beforeedit: function(e, o) { 33 beforeedit: function(e, o) {
33 if (o.record.get('readonly') == true) { 34 if (o.record.get('readonly') == true) {
138 this.store.load({ 139 this.store.load({
139 params: { 140 params: {
140 messungsId: this.recordId 141 messungsId: this.recordId
141 } 142 }
142 }); 143 });
144 },
145
146 setReadOnly: function(b) {
147 if (b == true){
148 //Readonly
149 if (this.getPlugin('rowedit')){
150 this.getPlugin('rowedit').disable();
151 }
152 this.down('button[action=delete]').disable();
153 this.down('button[action=add]').disable();
154 }else{
155 //Writable
156 if (this.getPlugin('rowedit')){
157 this.getPlugin('rowedit').enable();
158 }
159 this.down('button[action=delete]').enable();
160 this.down('button[action=add]').enable();
161 }
143 } 162 }
144 }); 163 });

http://lada.wald.intevation.org