View Full Version : Multiple ContentPanels with Iframe
emendez
27 May 2007, 11:14 PM
Please consider this code snippet:
var filefrm = Ext.DomHelper.append(document.body, {tag: 'iframe', frameBorder: 0, src: './0/'+unid+'?opendocument'});
var docpanel=new Ext.ContentPanel(filefrm,{id:unid,title:doctitle,fitToFrame:true,closable:true});
layout.add('center',docpanel);
Upon close/remove, will the contentpanel destroy the iframe as well?
My concern is whether 'orphaned' iframes will remain in the DOM after multiple panels (with iframes) are created and subsequently closed.
Regards.
liggett78
28 May 2007, 12:05 AM
I would guess yes, but not sure. Why don't you just try to run your code and see it with Firebug? BTW, ContentPanel has the "url" property for the page to show inside the panel, so you don't necessarily have to use iframe's.
emendez
28 May 2007, 6:17 AM
Actually I did try with firebug but didn't reach anywhere- didn't observe any new iframes added to the dom inspector (quite possible I wasn't doing it right).
I wouldn't consider seturl for loading 'complex' content (ie another page with its own css,js etc), hence the iframe approach.
Unfortunately, especially with IE7, opening and closing multiple iframe-enabled panels increases the application's memory footprint. Could be something I'm doing wrong, or it could be something else (still learning the finer points of this library- trying to get a customer buy-in via a pilot app). The iframe content in each instance consists of a document with multiple ext.form fields, not sure if this has any significance.
liggett78
28 May 2007, 12:45 PM
Well, after appending the iframe look under the HTML tab in Firebug to see, if iframe has been added (you may need to expand nodes). Then remove the panel and look again whether the frame disappears.
emendez
28 May 2007, 3:45 PM
Thanks liggett. I now do see that the iframes were removed after closing the contentpanel (was looking under DOM instead of HTML). Unfortunately, that doesn't seem to free up resources. Again, this is mainly an issue with IE7, FF seems to cope much better, almost satisfactorily. Unfortunately the potential customer uses IE by policy. Will continue to investigate and report back if I find anything.
Regards
liggett78
28 May 2007, 11:13 PM
The js garbage collector will not necessarily free resources just after the iframe is gone. So that's always hard to tell. Just make sure that your iframe or other child elements in it are not referenced anymore in event handlers etc...
Have this been sorted out? I am struggeling with same issue with iframes. It does not release any view'able memory and is consuming a lot on each tab/iframe. I also need to stick with ie7...
Thx Thor
markos
21 Aug 2007, 2:25 PM
Similarly, I am interested in knowing how Ext uses/frees memory. Here's my post from earlier today:
http://extjs.com/forum/showthread.php?t=11438
I also have a thread before I discovered this one, which is updated today with my progress
http://extjs.com/forum/showthread.php?t=11406
Thor
RWaters
22 Aug 2007, 11:44 AM
I posted the fix we came up with for Ext.nd in the url from Thor's post above.
Powered by vBulletin® Version 4.1.5 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.