diff 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
line wrap: on
line diff
--- 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);
+            }
+        }
     }
 });
 

http://lada.wald.intevation.org