X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/c930e9176a5a85509c5b0230e2bff5c22a591432..05ce1c11e98b33f14ddee184493bd5a60dc947e2:/docs/source/ColumnModel.html diff --git a/docs/source/ColumnModel.html b/docs/source/ColumnModel.html index 1f787ccb..dcf24c0f 100644 --- a/docs/source/ColumnModel.html +++ b/docs/source/ColumnModel.html @@ -1,11 +1,17 @@ - - - The source code - - - - -
/** + + + The source code + + + + +
/*!
+ * Ext JS Library 3.0.3
+ * Copyright(c) 2006-2009 Ext JS, LLC
+ * licensing@extjs.com
+ * http://www.extjs.com/license
+ */
+
/** * @class Ext.grid.ColumnModel * @extends Ext.util.Observable *

After the data has been read into the client side cache ({@link Ext.data.Store Store}), @@ -36,7 +42,7 @@ * {@link Ext.grid.Column} column configuration object within the specified Array defines the initial * order of the column display. A Column's display may be initially hidden using the * {@link Ext.grid.Column#hidden hidden} config property (and then shown using the column - * header menu). Field's that are not included in the ColumnModel will not be displayable at all.

+ * header menu). Fields that are not included in the ColumnModel will not be displayable at all.

*

How each column in the grid correlates (maps) to the {@link Ext.data.Record} field in the * {@link Ext.data.Store Store} the column draws its data from is configured through the * {@link Ext.grid.Column#dataIndex dataIndex}. If the @@ -215,12 +221,16 @@ Ext.extend(Ext.grid.ColumnModel, Ext.util.Observable, { this.config = config; this.lookup = {}; - // if no id, create one + for(i = 0, len = config.length; i < len; i++){ c = Ext.applyIf(config[i], this.defaults); + // if no id, create one using column's ordinal position + if(typeof c.id == 'undefined'){ + c.id = i; + } if(!c.isColumn){ - var cls = Ext.grid.Column.types[c.xtype || 'gridcolumn']; - c = new cls(c); + var Cls = Ext.grid.Column.types[c.xtype || 'gridcolumn']; + c = new Cls(c); config[i] = c; } this.lookup[c.id] = c; @@ -314,7 +324,7 @@ var columns = grid.getColumnModel().getColumnsBy(function(c){ * @return {Boolean} */ isSortable : function(col){ - return this.config[col].sortable; + return !!this.config[col].sortable; },

/** @@ -521,22 +531,24 @@ var grid = new Ext.grid.GridPanel({ this.config[col].editable = editable; }, -
/** - * Returns true if the column is hidden. + * Returns true if the column is {@link Ext.grid.Column#hidden hidden}, + * false otherwise. * @param {Number} colIndex The column index * @return {Boolean} */ isHidden : function(colIndex){ - return this.config[colIndex].hidden; + return !!this.config[colIndex].hidden; // ensure returns boolean }, -
/** - * Returns true if the column width cannot be changed + * Returns true if the column is {@link Ext.grid.Column#fixed fixed}, + * false otherwise. + * @param {Number} colIndex The column index + * @return {Boolean} */ isFixed : function(colIndex){ - return this.config[colIndex].fixed; + return !!this.config[colIndex].fixed; },
/** @@ -590,6 +602,6 @@ Ext.grid.ColumnModel.defaultRenderer = function(value){ return " "; } return value; -};
- +};
+ \ No newline at end of file