-<html>\r
-<head>\r
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> \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>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <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.2.0
+ * Copyright(c) 2006-2010 Ext JS, Inc.
+ * 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>),
* configuration options to all <tt><b>{@link #columns}</b></tt>. Configuration options specified with
* individual {@link Ext.grid.Column column} configs will supersede these <tt><b>{@link #defaults}</b></tt>.
*/
-
+
constructor : function(config){
<div id="prop-Ext.grid.ColumnModel-config"></div>/**
* An Array of {@link Ext.grid.Column Column definition} objects representing the configuration
delete this.totalWidth;
for(i = 0, len = this.config.length; i < len; i++){
c = this.config[i];
- if(c.editor){
- c.editor.destroy();
+ if(c.setEditor){
+ //check here, in case we have a special column like a CheckboxSelectionModel
+ c.setEditor(null);
}
}
}
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'){
+ if(Ext.isEmpty(c.id)){
c.id = i;
}
if(!c.isColumn){
}
return this.config[col].renderer;
},
-
+
getRendererScope : function(col){
return this.config[col].scope;
},
* @return {Boolean}
*/
isCellEditable : function(colIndex, rowIndex){
- return (this.config[colIndex].editable || (typeof this.config[colIndex].editable == "undefined" && this.config[colIndex].editor)) ? true : false;
+ var c = this.config[colIndex],
+ ed = c.editable;
+
+ //force boolean
+ return !!(ed || (!Ext.isDefined(ed) && c.editor));
},
<div id="method-Ext.grid.ColumnModel-getCellEditor"></div>/**
* @param {Object} editor The editor object
*/
setEditor : function(col, editor){
- Ext.destroy(this.config[col].editor);
- this.config[col].editor = editor;
+ this.config[col].setEditor(editor);
},
<div id="method-Ext.grid.ColumnModel-destroy"></div>/**
* Destroys this column model by purging any event listeners, and removing any editors.
*/
destroy : function(){
- for(var i = 0, c = this.config, len = c.length; i < len; i++){
- Ext.destroy(c[i].editor);
+ var c;
+ for(var i = 0, len = this.config.length; i < len; i++){
+ c = this.config[i];
+ if(c.setEditor){
+ c.setEditor(null);
+ }
}
this.purgeListeners();
}
return " ";
}
return value;
-};</pre> \r
-</body>\r
+};</pre>
+</body>
</html>
\ No newline at end of file