if(!initial){ // cleanup
delete this.totalWidth;
for(i = 0, len = this.config.length; i < len; i++){
- c = this.config[i];
- if(c.editor){
- c.editor.destroy();
- }
+ this.config[i].destroy();
}
}
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 {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);
+ for(var i = 0, len = this.config.length; i < len; i++){
+ this.config[i].destroy();
}
this.purgeListeners();
}