comparison app/view/grid/Probenzusatzwert.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 0c8e689f3bcb
comparison
equal deleted inserted replaced
683:612f4f933083 684:69cb367c0a63
28 28
29 initComponent: function() { 29 initComponent: function() {
30 this.rowEditing = Ext.create('Ext.grid.plugin.RowEditing', { 30 this.rowEditing = Ext.create('Ext.grid.plugin.RowEditing', {
31 clicksToMoveEditor: 1, 31 clicksToMoveEditor: 1,
32 autoCancel: false, 32 autoCancel: false,
33 pluginId: 'rowedit',
33 listeners:{ 34 listeners:{
34 // Make row ineditable when readonly is set to true 35 // Make row ineditable when readonly is set to true
35 // Normally this would belong into a controller an not the view. 36 // Normally this would belong into a controller an not the view.
36 beforeedit: function(e, o) { 37 beforeedit: function(e, o) {
37 if (o.record.get('readonly') == true) { 38 if (o.record.get('readonly') == true) {
154 this.store.load({ 155 this.store.load({
155 params: { 156 params: {
156 probeId: this.recordId 157 probeId: this.recordId
157 } 158 }
158 }); 159 });
160 },
161
162 setReadOnly: function(b) {
163 if (b == true){
164 //Readonly
165 if (this.getPlugin('rowedit')){
166 this.getPlugin('rowedit').disable();
167 }
168 this.down('button[action=delete]').disable();
169 this.down('button[action=add]').disable();
170 }else{
171 //Writable
172 if (this.getPlugin('rowedit')){
173 this.getPlugin('rowedit').enable();
174 }
175 this.down('button[action=delete]').enable();
176 this.down('button[action=add]').enable();
177 }
159 } 178 }
160 }); 179 });

http://lada.wald.intevation.org