Mercurial > lada > lada-client
comparison app/view/grid/Messwert.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 | aedf0709af92 |
comparison
equal
deleted
inserted
replaced
683:612f4f933083 | 684:69cb367c0a63 |
---|---|
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 pluginId: 'rowedit', | |
35 listeners:{ | 36 listeners:{ |
36 // Make row ineditable when readonly is set to true | 37 // Make row ineditable when readonly is set to true |
37 // Normally this would belong into a controller an not the view. | 38 // Normally this would belong into a controller an not the view. |
38 beforeedit: function(e, o) { | 39 beforeedit: function(e, o) { |
39 if (o.record.get('readonly') == true) { | 40 if (o.record.get('readonly') == true) { |
161 this.store.load({ | 162 this.store.load({ |
162 params: { | 163 params: { |
163 messungsId: this.recordId | 164 messungsId: this.recordId |
164 } | 165 } |
165 }); | 166 }); |
167 }, | |
168 | |
169 setReadOnly: function(b) { | |
170 if (b == true){ | |
171 //Readonly | |
172 if (this.getPlugin('rowedit')){ | |
173 this.getPlugin('rowedit').disable(); | |
174 } | |
175 this.down('button[action=delete]').disable(); | |
176 this.down('button[action=add]').disable(); | |
177 }else{ | |
178 //Writable | |
179 } | |
166 } | 180 } |
167 }); | 181 }); |