comparison app/view/proben/Edit.js @ 43:9176ad09a4f1

Added testfunction (not working) to initialize the comboboxes with a given value after rendering the edit window. This needs work!
author Torsten Irländer <torsten.irlaender@intevation.de>
date Fri, 24 May 2013 16:40:11 +0200
parents 5ed477590736
children 40843e4420bb
comparison
equal deleted inserted replaced
42:5ed477590736 43:9176ad09a4f1
379 var fields = new Array(); 379 var fields = new Array();
380 for ($i=0; $i<12; $i++) { 380 for ($i=0; $i<12; $i++) {
381 fields[$i] = {fieldLabel: 'S'+$i, name: 's'+$i}; 381 fields[$i] = {fieldLabel: 'S'+$i, name: 's'+$i};
382 } 382 }
383 return fields; 383 return fields;
384 },
385 listeners: {
386 afterrender: function() {
387 // FIXME: This does not work! I do not know how to set the correct
388 // value in the combobox based on the model value.
389 // Will iterate over defined comboboxes and set the value
390 var combos = ['probenart', 'datenbasis'];
391 for (var i = combos.length - 1; i >= 0; i--){
392 console.log('Searching for ' + combos[i]);
393 var element = Ext.getCmp(combos[i]);
394 // Statically set to 2. Must be the value from the model.
395 element.setValue(2);
396 }
397 }
384 } 398 }
385 }); 399 });
386 400

http://lada.wald.intevation.org