-<html>\r
-<head>\r
- <title>The source code</title>\r
- <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />\r
- <script type="text/javascript" src="../resources/prettify/prettify.js"></script>\r
-</head>\r
-<body onload="prettyPrint();">\r
- <pre class="prettyprint lang-js"><div id="cls-Ext.grid.ColumnModel"></div>/**
+<html>
+<head>
+ <title>The source code</title>
+ <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
+ <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
+</head>
+<body onload="prettyPrint();">
+ <pre class="prettyprint lang-js">/*!
+ * Ext JS Library 3.0.3
+ * Copyright(c) 2006-2009 Ext JS, LLC
+ * licensing@extjs.com
+ * http://www.extjs.com/license
+ */
+<div id="cls-Ext.grid.ColumnModel"></div>/**
* @class Ext.grid.ColumnModel
* @extends Ext.util.Observable
* <p>After the data has been read into the client side cache (<b>{@link Ext.data.Store Store}</b>),
* {@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
* <tt>{@link Ext.grid.Column#hidden hidden}</tt></b> 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.</p>
+ * header menu). Fields that are not included in the ColumnModel will not be displayable at all.</p>
* <p>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
* <b><tt>{@link Ext.grid.Column#dataIndex dataIndex}</tt></b>. If the
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;
* @return {Boolean}
*/
isSortable : function(col){
- return this.config[col].sortable;
+ return !!this.config[col].sortable;
},
<div id="method-Ext.grid.ColumnModel-isMenuDisabled"></div>/**
this.config[col].editable = editable;
},
-
<div id="method-Ext.grid.ColumnModel-isHidden"></div>/**
- * Returns true if the column is hidden.
+ * Returns <tt>true</tt> if the column is <code>{@link Ext.grid.Column#hidden hidden}</code>,
+ * <tt>false</tt> 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
},
-
<div id="method-Ext.grid.ColumnModel-isFixed"></div>/**
- * Returns true if the column width cannot be changed
+ * Returns <tt>true</tt> if the column is <code>{@link Ext.grid.Column#fixed fixed}</code>,
+ * <tt>false</tt> otherwise.
+ * @param {Number} colIndex The column index
+ * @return {Boolean}
*/
isFixed : function(colIndex){
- return this.config[colIndex].fixed;
+ return !!this.config[colIndex].fixed;
},
<div id="method-Ext.grid.ColumnModel-isResizable"></div>/**
return " ";
}
return value;
-};</pre> \r
-</body>\r
+};</pre>
+</body>
</html>
\ No newline at end of file