X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/6e39d509471fe9b4e2660e0d1631b350d0c66f40..c8256059947f3aa8f5b0a9a2acf55e2142bb4742:/docs/source/ColumnModel.html diff --git a/docs/source/ColumnModel.html b/docs/source/ColumnModel.html index ad5edcf6..a7bd6f5e 100644 --- a/docs/source/ColumnModel.html +++ b/docs/source/ColumnModel.html @@ -1,12 +1,18 @@ - -
- -/** + + + ++ \ No newline at end of fileThe source code + + + + +/*! + * Ext JS Library 3.2.1 + * Copyright(c) 2006-2010 Ext JS, Inc. + * 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}), @@ -113,7 +119,7 @@ Ext.grid.ColumnModel = Ext.extend(Ext.util.Observable, { * configuration options to all {@link #columns}. Configuration options specified with * individual {@link Ext.grid.Column column} configs will supersede these {@link #defaults}. */ - + constructor : function(config){
/** * An Array of {@link Ext.grid.Column Column definition} objects representing the configuration @@ -203,8 +209,9 @@ Ext.grid.ColumnModel = Ext.extend(Ext.util.Observable, { 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); } } } @@ -221,7 +228,7 @@ Ext.grid.ColumnModel = Ext.extend(Ext.util.Observable, { 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){ @@ -345,7 +352,7 @@ var columns = grid.getColumnModel().getColumnsBy(function(c){ } return this.config[col].renderer; }, - + getRendererScope : function(col){ return this.config[col].scope; }, @@ -510,7 +517,11 @@ var grid = new Ext.grid.GridPanel({ * @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)); }, /** @@ -583,16 +594,19 @@ myGrid.getColumnModel().setHidden(0, true); // hide column 0 (0 = the first colu * @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); }, /** * 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(); } @@ -604,6 +618,6 @@ Ext.grid.ColumnModel.defaultRenderer = function(value){ return " "; } return value; -};