PDA

View Full Version : [FIXED][3.0rc1.1] incomplete destroy of htmleditor



Nash-T
5 May 2009, 2:56 PM
Form loaded in a panel. The form contains an htmleditor. When I try to call:


Ext.getCmp('panelContainingFormWithHTMLEditor').destroy();
The panel is only partially destroyed.

debugger result: The destroy call does not complete (no return of void)

temporary work around:

changed code in ext-all-debug.js at line 34218 from:


this.wrap.dom.innerHTML = '';
this.wrap.remove();
to:



if (this.wrap.dom){
this.wrap.dom.innerHTML = '';
this.wrap.remove();
}
I have no idea what the impact of this code change is. DO NOT USE in production code.

Environment:
ext 3.0 rc1.1
firefox 3 mac tiger

I haven't checked for a fix in SVN
Thanks!
-Tim

evant
5 May 2009, 8:52 PM
Are you saying the destroy method is throwing an exception?

Nash-T
6 May 2009, 12:00 PM
The onDestroy method is throwing:

"this.wrap.dom is null"

when running onDestroy at line 34216 of ex-all-debug.js

From Firebug:


onDestroy()()ext-all-debug.js (line 34216)
destroy()()ext-all-debug.js (line 14977)
destroyMembers()()ext-base.js (line 31)
destroy()(Object initialConfig=Object xtype=htmleditor)ext-all-debug.js (line 33043)
each()(function(), undefined)ext-all-debug.js (line 7140)
destroy()()ext-all-debug.js (line 33042)
destroyMembers()()ext-base.js (line 31)
beforeDestroy()()ext-all-debug.js (line 33421)
destroy()()ext-all-debug.js (line 14969)
destroyMembers()()ext-base.js (line 31)
beforeDestroy()()ext-all-debug.js (line 16789)
beforeDestroy()()ext-all-debug.js (line 19597)
destroy()()ext-all-debug.js (line 14969)
destroyMembers()()ext-base.js (line 31)

//my call
buildForm("jsonFormId", "no")
I tested the destroy of a panel containing a form that has 2 htmleditors using this code:


console.log(this.wrap.dom);
if (this.wrap.dom){

this.wrap.dom.innerHTML = '';
this.wrap.remove();
}
and got this output:



<div id="ext-gen148" class="x-html-editor-wrap" style="width: 0px;">
<div id="ext-gen209" class="x-html-editor-wrap" style="width: 0px;">
null
null



and it successful destroyed the panel with the form in it.

evant
6 May 2009, 6:34 PM
I've added some extra cleanup code for the editor, your fix in included. Thanks.