PDA

View Full Version : [CLOSED][3.3.0-rc]Ext.grid.ColumnModel -> destroy



tobiu
4 Oct 2010, 3:53 AM
hi team,

this method seems to have changed in 3.3:



destroy : function() {
var length = this.config.length,
i = 0;

for (; i < length; i++){
this.config[i].destroy(); // Column's destroy encapsulates all cleanup.
}
delete this.config;
delete this.lookup;
this.purgeListeners();
}


i sometimes get the error in firebug:

this.config[i].destroy is not a function
[Break on this error] this.config[i].destroy();

i guess it happens when a column or the cm itself is not yet rendered when calling destroy().
adding a check for this should help.


kind regards
tobiu

tobiu
4 Oct 2010, 4:01 AM
update: the theory was wrong. the error occured when using sakis rowactions-plugin with 3.3 (the column does not have a destroy-method).

so, this is not really an ext bug. i added a check if destroy exists, just in case.



Ext.override(Ext.grid.ColumnModel, {
destroy : function() {
var length = this.config.length,
i = 0;

for (; i < length; i++){
if(typeof this.config[i].destroy == 'function'){
this.config[i].destroy(); // Column's destroy encapsulates all cleanup.
}
}
delete this.config;
delete this.lookup;
this.purgeListeners();
}
});

Animal
4 Oct 2010, 4:09 AM
RowActions have been replaced by ActionColumn in 3.3

http://dev.sencha.com/deploy/ext-3.3-beta1-6976/docs/?class=Ext.grid.ActionColumn

http://dev.sencha.com/deploy/ext-3.3-beta1-6976/examples/grid/array-grid.html