Mercurial > lada > lada-client
comparison app/view/grid/PKommentar.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 |
---|---|
29 | 29 |
30 initComponent: function() { | 30 initComponent: function() { |
31 this.rowEditing = Ext.create('Ext.grid.plugin.RowEditing', { | 31 this.rowEditing = Ext.create('Ext.grid.plugin.RowEditing', { |
32 clicksToMoveEditor: 1, | 32 clicksToMoveEditor: 1, |
33 autoCancel: false, | 33 autoCancel: false, |
34 pluginId: 'rowedit', | |
34 listeners:{ | 35 listeners:{ |
35 // Make row ineditable when readonly is set to true | 36 // Make row ineditable when readonly is set to true |
36 // Normally this would belong into a controller an not the view. | 37 // Normally this would belong into a controller an not the view. |
37 beforeedit: function(e, o) { | 38 beforeedit: function(e, o) { |
38 if (o.record.get('readonly') == true) { | 39 if (o.record.get('readonly') == true) { |
107 this.store.load({ | 108 this.store.load({ |
108 params: { | 109 params: { |
109 probeId: this.recordId | 110 probeId: this.recordId |
110 } | 111 } |
111 }); | 112 }); |
113 }, | |
114 | |
115 setReadOnly: function(b) { | |
116 if (b == true){ | |
117 //Readonly | |
118 if (this.getPlugin('rowedit')){ | |
119 this.getPlugin('rowedit').disable(); | |
120 } | |
121 this.down('button[action=delete]').disable(); | |
122 this.down('button[action=add]').disable(); | |
123 }else{ | |
124 //Writable | |
125 if (this.getPlugin('rowedit')){ | |
126 this.getPlugin('rowedit').enable(); | |
127 } | |
128 this.down('button[action=delete]').enable(); | |
129 this.down('button[action=add]').enable(); | |
130 } | |
112 } | 131 } |
113 }); | 132 }); |