Roo/grid/ColumnModel.js
authorAlan Knowles <alan@akbkhome.com>
Wed, 4 Aug 2010 02:33:27 +0000 (10:33 +0800)
committerAlan Knowles <alan@akbkhome.com>
Wed, 4 Aug 2010 02:33:27 +0000 (10:33 +0800)
Roo/grid/ColumnModel.js

index c45ff42..74dd644 100644 (file)
@@ -180,6 +180,17 @@ Roo.extend(Roo.grid.ColumnModel, Roo.util.Observable, {
         return this.lookup[id];
     },
 
+    
+    /**
+     * Returns the column for a specified dataIndex.
+     * @param {String} dataIndex The column dataIndex
+     * @return {Object|Boolean} the column or false if not found
+     */
+    getIndexByDataIndex: function(dataIndex){
+        var index = this.findColumnIndex(dataIndex);
+        return ci > -1 ? this.his.config[index] : false;
+    },
+    
     /**
      * Returns the index for a specified column id.
      * @param {String} id The column id
@@ -193,6 +204,7 @@ Roo.extend(Roo.grid.ColumnModel, Roo.util.Observable, {
         }
         return -1;
     },
+    
     /**
      * Returns the index for a specified column dataIndex.
      * @param {String} dataIndex The column dataIndex