allow string based values for comboboxarray
[roojs1] / Roo / grid / ColumnModel.js
index fd97dbc..d1fa60d 100644 (file)
@@ -153,7 +153,7 @@ Roo.extend(Roo.grid.ColumnModel, Roo.util.Observable, {
     /**
      * @cfg {Function} renderer (Optional) A function used to generate HTML markup for a cell
      * given the cell's data value. See {@link #setRenderer}. If not specified, the
-     * default renderer uses the raw data value. If an object is returned (bootstrap only)
+     * default renderer returns the escaped data value. If an object is returned (bootstrap only)
      * then it is treated as a Roo Component object instance, and it is rendered after the initial row is rendered
      */
        /**
@@ -162,6 +162,9 @@ Roo.extend(Roo.grid.ColumnModel, Roo.util.Observable, {
     /**
      * @cfg {String} align (Optional) Set the CSS text-align property of the column.  Defaults to undefined.
      */
+    /**
+     * @cfg {String} valign (Optional) Set the CSS vertical-align property of the column (eg. middle, top, bottom etc).  Defaults to undefined.
+     */
     /**
      * @cfg {String} cursor (Optional)
      */
@@ -248,8 +251,6 @@ Roo.extend(Roo.grid.ColumnModel, Roo.util.Observable, {
     },
 
     isLocked : function(colIndex){
-        Roo.log('isLOcked');
-        Roo.log(colIndex);
         return this.config[colIndex].locked === true;
     },
 
@@ -274,13 +275,13 @@ Roo.extend(Roo.grid.ColumnModel, Roo.util.Observable, {
     },
 
     getLockedCount : function(){
-        Roo.log('getLockedCOunt');
-        Roo.log(this.config.length);
         for(var i = 0, len = this.config.length; i < len; i++){
             if(!this.isLocked(i)){
                 return i;
             }
         }
+        
+        return this.config.length;
     },
 
     /**
@@ -531,11 +532,16 @@ Roo.extend(Roo.grid.ColumnModel, Roo.util.Observable, {
     }
 });
 
-Roo.grid.ColumnModel.defaultRenderer = function(value){
+Roo.grid.ColumnModel.defaultRenderer = function(value)
+{
+    if(typeof value == "object") {
+        return value;
+    }
        if(typeof value == "string" && value.length < 1){
            return "&#160;";
        }
-       return value;
+    
+       return String.format("{0}", value);
 };
 
 // Alias for backwards compatibility