Mercurial > lada > lada-client
comparison app/view/grid/MKommentar.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) { |
104 this.store.load({ | 105 this.store.load({ |
105 params: { | 106 params: { |
106 messungsId: this.recordId | 107 messungsId: this.recordId |
107 } | 108 } |
108 }); | 109 }); |
110 }, | |
111 | |
112 setReadOnly: function(b) { | |
113 if (b == true){ | |
114 //Readonly | |
115 if (this.getPlugin('rowedit')){ | |
116 this.getPlugin('rowedit').disable(); | |
117 } | |
118 this.down('button[action=delete]').disable(); | |
119 this.down('button[action=add]').disable(); | |
120 }else{ | |
121 //Writable | |
122 if (this.getPlugin('rowedit')){ | |
123 this.getPlugin('rowedit').enable(); | |
124 } | |
125 this.down('button[action=delete]').enable(); | |
126 this.down('button[action=add]').enable(); | |
127 } | |
109 } | 128 } |
110 }); | 129 }); |