PDA

View Full Version : [2.0a1][SOLVED] loadMask.destroy() on hidden GridPanel



harley.333
5 Oct 2007, 8:57 AM
My layout has a closable TabPanel with three tabs and a GridPanel on each tab. By default, the first grid is viewable. If I close the TabPanel without viewing the other grids, I get an error. The error is coming from Ext.grid.GridPanel.onDestroy(). The line is:

this.loadMask.destroy();

this.loadMask is true

mystix
5 Oct 2007, 9:51 AM
pls post more details as per 13985.
a simple test case would be good too. thanks.

harley.333
5 Oct 2007, 10:03 AM
I'll get a simplified test case if I can get a spare moment. Here's the solution I'm using until it's fixed (in GridPanel.js).

old code:

onDestroy : function(){
if(this.loadMask){
this.loadMask.destroy();
}
if(this.rendered){
var c = this.body;
c.removeAllListeners();
this.view.destroy();
c.update("");
}
this.colModel.purgeListeners();
Ext.grid.GridPanel.superclass.onDestroy.call(this);
},
new code:

onDestroy : function(){
if(this.loadMask && this.loadMask !== true){
this.loadMask.destroy();
}
if(this.rendered){
var c = this.body;
c.removeAllListeners();
this.view.destroy();
c.update("");
}
this.colModel.purgeListeners();
Ext.grid.GridPanel.superclass.onDestroy.call(this);
},

jack.slocum
6 Oct 2007, 12:03 PM
Thanks. Fixed. I just moved it inside the this.rendered check.