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

Added Documentation to Windows
author Dustin Demuth <dustin@intevation.de>
date Thu, 23 Jul 2015 16:40:50 +0200
parents 135cd5814b15
children 8054232535ba
comparison
equal deleted inserted replaced
889:81fc61545638 890:def27cdd0dfa
28 layout: 'fit', 28 layout: 'fit',
29 constrain: true, 29 constrain: true,
30 30
31 record: null, 31 record: null,
32 32
33 /**
34 * This function initialises the Window
35 */
33 initComponent: function() { 36 initComponent: function() {
34 if (this.record === null) { 37 if (this.record === null) {
35 Ext.Msg.alert('Keine valide Probe ausgewählt!'); 38 Ext.Msg.alert('Keine valide Probe ausgewählt!');
36 this.callParent(arguments); 39 this.callParent(arguments);
37 return; 40 return;
114 }] 117 }]
115 }]; 118 }];
116 this.callParent(arguments); 119 this.callParent(arguments);
117 }, 120 },
118 121
122 /**
123 * Initialise the Data of this Window
124 */
119 initData: function() { 125 initData: function() {
120 this.setLoading(true); 126 this.setLoading(true);
121 this.clearMessages(); 127 this.clearMessages();
122 me = this; 128 me = this;
123 Ext.ClassManager.get('Lada.model.Probe').load(this.record.get('id'), { 129 Ext.ClassManager.get('Lada.model.Probe').load(this.record.get('id'), {
158 }, 164 },
159 scope: this 165 scope: this
160 }); 166 });
161 }, 167 },
162 168
169 /**
170 * Enable the Messungengrid
171 */
163 enableAddMessungen: function() { 172 enableAddMessungen: function() {
164 this.down('fset[name=messungen]').down('messunggrid').setReadOnly(false); 173 this.down('fset[name=messungen]').down('messunggrid').setReadOnly(false);
165 }, 174 },
166 175
176 /**
177 * Disable the Childelements of this window
178 */
167 disableChildren: function() { 179 disableChildren: function() {
168 if (!this.record.get('owner')) { 180 if (!this.record.get('owner')) {
169 // Disable only when the User is not the owner of the Probe 181 // Disable only when the User is not the owner of the Probe
170 // Works in symbiosis with success callback some lines above. 182 // Works in symbiosis with success callback some lines above.
171 this.down('fset[name=messungen]').down('messunggrid').setReadOnly(true); 183 this.down('fset[name=messungen]').down('messunggrid').setReadOnly(true);
177 this.down('fset[name=probenzusatzwerte]').down('probenzusatzwertgrid').readOnly = true; 189 this.down('fset[name=probenzusatzwerte]').down('probenzusatzwertgrid').readOnly = true;
178 this.down('fset[name=pkommentare]').down('pkommentargrid').setReadOnly(true); 190 this.down('fset[name=pkommentare]').down('pkommentargrid').setReadOnly(true);
179 this.down('fset[name=pkommentare]').down('pkommentargrid').readOnly = true; 191 this.down('fset[name=pkommentare]').down('pkommentargrid').readOnly = true;
180 }, 192 },
181 193
194 /**
195 * Enable the Childelements of this window
196 */
182 enableChildren: function() { 197 enableChildren: function() {
183 this.down('fset[name=messungen]').down('messunggrid').setReadOnly(false); 198 this.down('fset[name=messungen]').down('messunggrid').setReadOnly(false);
184 this.down('fset[name=messungen]').down('messunggrid').readOnly = false; 199 this.down('fset[name=messungen]').down('messunggrid').readOnly = false;
185 this.down('fset[name=orte]').down('ortgrid').setReadOnly(false); 200 this.down('fset[name=orte]').down('ortgrid').setReadOnly(false);
186 this.down('fset[name=orte]').down('ortgrid').readOnly = false; 201 this.down('fset[name=orte]').down('ortgrid').readOnly = false;
188 this.down('fset[name=probenzusatzwerte]').down('probenzusatzwertgrid').readOnly = false; 203 this.down('fset[name=probenzusatzwerte]').down('probenzusatzwertgrid').readOnly = false;
189 this.down('fset[name=pkommentare]').down('pkommentargrid').setReadOnly(false); 204 this.down('fset[name=pkommentare]').down('pkommentargrid').setReadOnly(false);
190 this.down('fset[name=pkommentare]').down('pkommentargrid').readOnly = false; 205 this.down('fset[name=pkommentare]').down('pkommentargrid').readOnly = false;
191 }, 206 },
192 207
208 /**
209 * Instructs the fields / forms listed in this method to set a message.
210 * @param errors These Errors shall be shown
211 * @param warnings These Warning shall be shown
212 */
193 setMessages: function(errors, warnings) { 213 setMessages: function(errors, warnings) {
194 this.down('probeform').setMessages(errors, warnings); 214 this.down('probeform').setMessages(errors, warnings);
195 var errorOrtText = ''; 215 var errorOrtText = '';
196 var errorOrt = false; 216 var errorOrt = false;
197 var warningOrtText = ''; 217 var warningOrtText = '';
228 warningOrtText === '' ? null : warningOrtText, 248 warningOrtText === '' ? null : warningOrtText,
229 errorOrt, 249 errorOrt,
230 errorOrtText === '' ? null : errorOrtText); 250 errorOrtText === '' ? null : errorOrtText);
231 }, 251 },
232 252
253 /**
254 * Instructs the fields / forms listed in this method to clear their messages.
255 */
233 clearMessages: function() { 256 clearMessages: function() {
234 this.down('probeform').clearMessages(); 257 this.down('probeform').clearMessages();
235 this.down('fset[name=orte]').clearMessages(); 258 this.down('fset[name=orte]').clearMessages();
236 } 259 }
237 }); 260 });

http://lada.wald.intevation.org