PDA

View Full Version : ExtJS 3.1/HtmlEditor IE7 issue



httpdotcom
10 Feb 2010, 7:57 AM
I have some pretty complex code, that is unfortunately sensitive in nature, so I can't publish very much.

Situation:
- Window with tab panel contains form elements and editor grid elements
- Button on tbar submits form elements
- Prior to submitting form elements, it checks to see if any grid has new records, and submits values

Issue:
- One grid has an HtmlEditor cell editor.
- In FF/IE8, this is not an issue, and everything posts fine/returns normally.
- In IE7, after grid submissions, form submission, and parent window close(), browser throws an "Object doesn't support this property or method" error, (using ext-all-debug.js) on HtmlEditor.getWin()


return Ext.isIE ? this.iframe.contentWindow : window.frames[this.iframe.name]

I have been digging in the forums and on google, and the closest thing I found was in dojo's patch list, here (http://trac.dojotoolkit.org/ticket/5904).

I was wondering if there were any overrides for HtmlEditor and IE7 floating around that resolved possible issues like these.

Thanks for reading. If I can supply some code chunks, please let me know.

example

function updatePanel() {
//check to see if record hasn't been updated since opening
Ext.Ajax.request( {
...
,onSuccess: function() {
if (gridObj.getStore().getModifiedRecords().length > 0 ) {
gridObj.getStore().getAt(0).endEdit() ;
//post grid
}
...
if ( form.getForm().isValid() ) //submit form
}
} ) ;
}

323066
11 Feb 2010, 4:29 AM
I have the same problem when trying to move to 3.1.1.
I call "destroy()" function and get the same exception on the same line.
Can you suggest some fix or workaround?

httpdotcom
11 Feb 2010, 9:46 AM
Well, I tried your idea of using destroy() on the window.beforeClose listener.

win.on( "beforeClose",function() { Ext.getCmp("htmled").destroy() ; } ) ;
I am getting positive results in IE7, and nothing broke in IE8. YMMV.

323066
12 Feb 2010, 1:31 AM
Actually my situation is more complex then I've described.
I just wanted to notice that I get the same exception, so "steps to reproduce" are not detailed.
I have ASP.Net application with UpdatePanel for my content where HtmlEditor is also located. At first load everything works correct. And after postback I need to re-initialize my HtmlEditor so I destroy previous and create new one. And in "destroy()" method I get this exception (in chrome, IE7 and Safari)
As we need to move to ExtJs 3.1.1 quickly, we made some rude fix.

Here is the code if you are interested :


Ext.override(Ext.form.HtmlEditor, {

getWin : function(){

//FIX HTML EDITOR FOR CHROME
if ((Ext.isChrome || Ext.isSafari) && !window.frames[this.iframe.name])
{
for(var i = 0; i < window.frames.length; i ++)
{
if (window.frames[i].name == "ux-lightbox-shim")
return window.frames[i];
}
}

//Fix HTML EDITOR FOR IE7
if (Ext.isIE7)
{
var frames = document.getElementsByTagName("iframe");

for (var i = 0; i < frames.length; i++)
{
if (frames[i] == this.iframe)
return frames[i].contentWindow;
}

for (var i = 0; i < frames.length; i++)
{
if (frames[i].name == "")
{
return frames[i].contentWindow;
}
}

alert("The frame is not found for HtmlEditor");
}

return Ext.isIE ? this.iframe.contentWindow : window.frames[this.iframe.name];
}
});


I know fix is rude. If found better solution please share it! :)

mdissel
25 Mar 2010, 5:16 AM
Anyone fixed this issue? the last work-around doesn't work in my situtation.