allow string based values for comboboxarray
[roojs1] / Roo / form / Select.js
index aa38a79..77001b7 100644 (file)
@@ -179,6 +179,12 @@ Roo.extend(Roo.form.Select , Roo.form.ComboBox, {
      * the store, valueNotFoundText will be displayed as the field text if defined (defaults to undefined)
      */
     valueNotFoundText : undefined,
+    
+    /**
+     * @cfg {String} defaultValue The value displayed after loading the store.
+     */
+    defaultValue: '',
+    
     /**
      * @cfg {Boolean} blockFocus Prevents all focus calls, so it can work with things like HTML edtor bar
      */
@@ -292,7 +298,10 @@ Roo.extend(Roo.form.Select , Roo.form.ComboBox, {
                 op.innerHTML = String.format('{0}', r.data[df]);
                 dom.appendChild(op);
             });
-            this.setValue(this.value);
+            if (typeof(this.defaultValue != 'undefined')) {
+                this.setValue(this.defaultValue);
+            }
+            
              
         }else{
             //this.onEmptyResults();
@@ -602,5 +611,5 @@ Roo.extend(Roo.form.Select , Roo.form.ComboBox, {
     },
     getResizeEl : function(){
         return this.el;
-    },
+    }
 });
\ No newline at end of file