allow string based values for comboboxarray
[roojs1] / Roo / form / ComboCheck.js
index e3139d8..a6b8aeb 100644 (file)
@@ -87,7 +87,7 @@ Roo.extend(Roo.form.ComboCheck, Roo.form.ComboBox, {
         
     },
     select: function () {
-        Roo.log("SELECT CALLED");
+        //Roo.log("SELECT CALLED");
     },
      
     selectByValue : function(xv, scrollIntoView){
@@ -113,10 +113,11 @@ Roo.extend(Roo.form.ComboCheck, Roo.form.ComboBox, {
     onSelect : function(record, index){
        // Roo.log("onselect Called");
        // this is only called by the clear button now..
-       this.view.clearSelections();
-        this.setValue : function('[]');
+        this.view.clearSelections();
+        this.setValue('[]');
         if (this.value != this.valueBefore) {
             this.fireEvent('change', this, this.value, this.valueBefore);
+            this.valueBefore = this.value;
         }
     },
     getValueArray : function()
@@ -124,7 +125,10 @@ Roo.extend(Roo.form.ComboCheck, Roo.form.ComboBox, {
         var ar = [] ;
         
         try {
-            Roo.log(this.value);
+            //Roo.log(this.value);
+            if (typeof(this.value) == 'undefined') {
+                return [];
+            }
             var ar = Roo.decode(this.value);
             return  ar instanceof Array ? ar : []; //?? valid?
             
@@ -136,8 +140,10 @@ Roo.extend(Roo.form.ComboCheck, Roo.form.ComboBox, {
     },
     expand : function ()
     {
+        
         Roo.form.ComboCheck.superclass.expand.call(this);
-        this.valueBefore = this.value;
+        this.valueBefore = typeof(this.value) == 'undefined' ? '' : this.value;
+        //this.valueBefore = typeof(this.valueBefore) == 'undefined' ? '' : this.valueBefore;
         
 
     },
@@ -157,6 +163,7 @@ Roo.extend(Roo.form.ComboCheck, Roo.form.ComboBox, {
         if (this.value != this.valueBefore) {
 
             this.fireEvent('change', this, this.value, this.valueBefore);
+            this.valueBefore = this.value;
         }
         
     },