comparison app/view/window/MessungEdit.js @ 890:def27cdd0dfa

Added Documentation to Windows
author Dustin Demuth <dustin@intevation.de>
date Thu, 23 Jul 2015 16:40:50 +0200
parents 13c0e64e1873
children 8054232535ba
comparison
equal deleted inserted replaced
889:81fc61545638 890:def27cdd0dfa
30 probe: null, 30 probe: null,
31 parentWindow: null, 31 parentWindow: null,
32 record: null, 32 record: null,
33 grid: null, 33 grid: null,
34 34
35 /**
36 * This function initialises the Window
37 */
35 initComponent: function() { 38 initComponent: function() {
36 if (this.record === null) { 39 if (this.record === null) {
37 Ext.Msg.alert('Keine valide Messung ausgewählt!'); 40 Ext.Msg.alert('Keine valide Messung ausgewählt!');
38 this.callParent(arguments); 41 this.callParent(arguments);
39 return; 42 return;
117 }] 120 }]
118 }]; 121 }];
119 this.callParent(arguments); 122 this.callParent(arguments);
120 }, 123 },
121 124
125 /**
126 * Initialise the Data of this Window
127 */
122 initData: function() { 128 initData: function() {
123 this.clearMessages(); 129 this.clearMessages();
124 var that = this; 130 var that = this;
125 Ext.ClassManager.get('Lada.model.Messung').load(this.record.get('id'), { 131 Ext.ClassManager.get('Lada.model.Messung').load(this.record.get('id'), {
126 failure: function(record, response) { 132 failure: function(record, response) {
168 }, 174 },
169 scope: this 175 scope: this
170 }); 176 });
171 }, 177 },
172 178
179 /**
180 * Disable the Forms in this Window.
181 * Also disable this Windows Children
182 */
173 disableForm: function() { 183 disableForm: function() {
174 this.down('messungform').setReadOnly(true); 184 this.down('messungform').setReadOnly(true);
175 this.disableChildren(); 185 this.disableChildren();
176 }, 186 },
177 187
188 /**
189 * Enable the Forms in this Window.
190 * Also enble this Windows Children
191 */
178 enableForm: function() { 192 enableForm: function() {
179 this.down('messungform').setReadOnly(false); 193 this.down('messungform').setReadOnly(false);
180 this.enableChildren(); 194 this.enableChildren();
181 }, 195 },
182 196
197 /**
198 * Disable the Chilelements of this window
199 */
183 disableChildren: function() { 200 disableChildren: function() {
184 this.down('fset[name=messwerte]').down('messwertgrid').setReadOnly(true); 201 this.down('fset[name=messwerte]').down('messwertgrid').setReadOnly(true);
185 this.down('fset[name=messwerte]').down('messwertgrid').readOnly = true; 202 this.down('fset[name=messwerte]').down('messwertgrid').readOnly = true;
186 this.down('fset[name=messungstatus]').down('statusgrid').setReadOnly(true); 203 this.down('fset[name=messungstatus]').down('statusgrid').setReadOnly(true);
187 this.down('fset[name=messungstatus]').down('statusgrid').readOnly = true; 204 this.down('fset[name=messungstatus]').down('statusgrid').readOnly = true;
188 this.down('fset[name=messungskommentare]').down('mkommentargrid').setReadOnly(true); 205 this.down('fset[name=messungskommentare]').down('mkommentargrid').setReadOnly(true);
189 this.down('fset[name=messungskommentare]').down('mkommentargrid').readOnly = true; 206 this.down('fset[name=messungskommentare]').down('mkommentargrid').readOnly = true;
190 }, 207 },
191 208
209 /**
210 * Enable the Childelements of this window
211 */
192 enableChildren: function() { 212 enableChildren: function() {
193 this.down('fset[name=messwerte]').down('messwertgrid').setReadOnly(false); 213 this.down('fset[name=messwerte]').down('messwertgrid').setReadOnly(false);
194 this.down('fset[name=messwerte]').down('messwertgrid').readOnly = false; 214 this.down('fset[name=messwerte]').down('messwertgrid').readOnly = false;
195 this.down('fset[name=messungstatus]').down('statusgrid').setReadOnly(false); 215 this.down('fset[name=messungstatus]').down('statusgrid').setReadOnly(false);
196 this.down('fset[name=messungstatus]').down('statusgrid').readOnly = false; 216 this.down('fset[name=messungstatus]').down('statusgrid').readOnly = false;
197 this.down('fset[name=messungskommentare]').down('mkommentargrid').setReadOnly(false); 217 this.down('fset[name=messungskommentare]').down('mkommentargrid').setReadOnly(false);
198 this.down('fset[name=messungskommentare]').down('mkommentargrid').readOnly = false; 218 this.down('fset[name=messungskommentare]').down('mkommentargrid').readOnly = false;
199 }, 219 },
200 220
221 /**
222 * Instructs the fields / forms listed in this method to set a message.
223 * @param errors These Errors shall be shown
224 * @param warnings These Warning shall be shown
225 */
201 setMessages: function(errors, warnings) { 226 setMessages: function(errors, warnings) {
202 this.down('messungform').setMessages(errors, warnings); 227 this.down('messungform').setMessages(errors, warnings);
203 }, 228 },
229
230 /**
231 * Instructs the fields / forms listed in this method to clear their messages.
232 */
204 clearMessages: function() { 233 clearMessages: function() {
205 this.down('messungform').clearMessages(); 234 this.down('messungform').clearMessages();
206 } 235 }
207 236
208 }); 237 });

http://lada.wald.intevation.org