View Full Version : iframe contents vanish - or go backwards!! - on expand

Tim Ward
5 Aug 2014, 1:23 AM
I've got a Viewport with a menu tree in the "west" region and a panel with "card" layout in the "center" region.

The menu tree in the "west" region has "collapsible" (and "split").

The card layout in the "center" region has a number of panels, the interesting one of which is an iframe identified by contentEl (no, I wouldn't design it like that starting from scratch today, but that's how it is).

When one of the other panels is visible in the "center" region, collapsing and expanding the menu tree in the "west" region works fine.

However there's a problem when the iframe panel is visible in the "center" region and the menu tree in the "west" region is collapsed and then expanded again:

(1) With Ext JS 3.4, on expand the menu is redrawn, and the iframe contents shift to the right, all as expected.

(2) With Ext JS 4.1.3, on expand the menu is redrawn, and the iframe contents appear to be deleted - the panel goes blank. What happens next is browser dependent:

- with Firefox, sometimes the iframe stays blank, sometimes it refreshes with (apparently) a reload from scratch of the correct contents, and sometimes (this is the really weird one) it refreshes with a reload of some previous contents of the iframe (ie not the HTML page that was being displayed immediately prior to the expand but some other HTML page that was being displayed some time earlier in the life of the application)

- with Chrome the iframe always stays blank, and "show frame source" is completely empty.

My question is:

How do I start trying to work out what's going on here, so as to be able to restore the Ext JS 3.4 functionality, ie you can collapse and re-expand the menu without destroying the contents of the iframe?

(Tracing through the Ext JS code in the Chrome debugger shows the iframe content disappearing somewhere around a call to an insertBefore function returning, but the debugger doesn't appear to show the code that's actually causing the disappearance.)

Gary Schlosberg
5 Aug 2014, 5:41 AM
Difficult to say what is going on without watching it run. Anything unsual being displayed in the iframe? You might consider removing it from the equation unless you continue to have a good reason for it.

Tim Ward
6 Aug 2014, 12:35 AM
The "unusual things being displayed in the iframe" are as described in the original post. I can't remove it! - the entire application takes place in the iframe, with different pages being loaded as different menu entries are selected.