# HG changeset patch # User Torsten Irländer # Date 1369406411 -7200 # Node ID 9176ad09a4f1f0e44ca01419056f863059c548e8 # Parent 5ed47759073676c3363eef87e29cc2d4815a71b4 Added testfunction (not working) to initialize the comboboxes with a given value after rendering the edit window. This needs work! diff -r 5ed477590736 -r 9176ad09a4f1 app/view/proben/Edit.js --- a/app/view/proben/Edit.js Fri May 24 16:38:56 2013 +0200 +++ b/app/view/proben/Edit.js Fri May 24 16:40:11 2013 +0200 @@ -381,6 +381,20 @@ fields[$i] = {fieldLabel: 'S'+$i, name: 's'+$i}; } return fields; + }, + listeners: { + afterrender: function() { + // FIXME: This does not work! I do not know how to set the correct + // value in the combobox based on the model value. + // Will iterate over defined comboboxes and set the value + var combos = ['probenart', 'datenbasis']; + for (var i = combos.length - 1; i >= 0; i--){ + console.log('Searching for ' + combos[i]); + var element = Ext.getCmp(combos[i]); + // Statically set to 2. Must be the value from the model. + element.setValue(2); + } + } } });