View Full Version : Error on IE only when opening grid in ManagedIframe

20 Jul 2008, 2:09 PM
I hope someone can help me with the following problem:

I want to create an application on base of the desktop example opening ext-windows which contain ManagedIframes (MIF) which then load webpages that also can be called separately in a browser window. These webpages may on their turn be created with ext e.g. putting a grid into a viewport.

On FF I hav no problem doing this.

On IE I have a problem with the timing of object definitions. Therefore I build a small test appliccation added to this as zip file. First extract IEtest7.zip to a local dir. a dir named testapp_files wil be created. Into this you can extract the extimg.zip containing images for ext. After extracting there is the file gridtest.html which shows an empty grid. I did not call the stores load function to make the test quicker because this does not refer to the problem. This file opens well in IE all the time.
If you open testapp.html the same page should be opened in a MIF-Window by pressing the button "Main Menu Item" and then "Open Grid in MIF".

The result should be:

The error I do not understand happens only sometimes on IE not always. Usually I clear the cache and after reloading testapp.html I open the grid window as soon as the button is visible.

The the following error occurs:

The script-debugger says the error is at line 4035 (in red) of ext-all-debug.js:
getScroll : function(){
var d = this.dom, doc = document;
if(d == doc || d == doc.body){
var l, t;
if(Ext.isIE && Ext.isStrict){
l = doc.documentElement.scrollLeft || (doc.body.scrollLeft || 0);
t = doc.documentElement.scrollTop || (doc.body.scrollTop || 0);
l = window.pageXOffset || (doc.body.scrollLeft || 0);
t = window.pageYOffset || (doc.body.scrollTop || 0);
return {left: l, top: t};
return {left: d.scrollLeft, top: d.scrollTop};
I have the impression that the error only happens if button is used very quickly after loading the app. Waiting long enough or opening the window a secound time seems to allow IE the define all objects correctly. But I have no idea anymore why IE is producing that error at all and I wonder if this relates to a problem of ext with IE which is of more general nature. It almost looks as if the onReady-Routine is not called at the right time. Can it be a problem in IE loading ext twice, into the top window and into the iframe? I know this can be avoided later by enabling the iframe using the ext-lib of the top frame, but I wanted to be able to call the single "windows" separately, too.

If anybody can help me with this I

10 Oct 2008, 4:43 AM

Did you by any chance find a solution to this problem? I'm getting the exact same error when loading a grid in an Iframe. It also seems to be timing-related -- the longer it takes to load the Javascript, the more likely it is to fail.

10 Oct 2008, 10:04 AM
If you're running Ext 2.2, it may be related to this (http://extjs.com/forum/showthread.php?t=43246) thread.

12 Oct 2008, 2:45 AM
The problem went away when i put Ext.onLoad in a separate javascript file and added a 'defer' attribute to the <script> tag that included it.