PDA

View Full Version : IE6 crashed when Ext.QickTips are enabled



schmidetzki
2 Apr 2007, 8:28 AM
When I move the mouse over one of my dialogs I6 crashes.
(This also happens in Alpha3)

tryanDLS
2 Apr 2007, 1:46 PM
It looks like the Layer creation for Quicktips is failing b/c document.body is not available yet.

EDIT: Try moving your Ext.Quicktips.init() call down to the end of your initialization routine. Depending on when you call init, it's possible the document isn't loaded yet.

schmidetzki
3 Apr 2007, 11:37 AM
Try moving your Ext.Quicktips.init() call down to the end of your initialization routine. Depending on when you call init, it's possible the document isn't loaded yet.

If have the QuickTips.init() at the end of my code inside Ext.onReady().
The strange thing is, that I have a lot of dialogs and all work well except of one that causes the IE-crash. I realy see not difference in this special dialog :-( When I don't use QuickTips all works fine however.

tryanDLS
3 Apr 2007, 12:37 PM
Well, 'at the end' may still be a problem, depending on your code flow. See the 2 points in this sample


var HelloWorld = function(){
// define some private variables
var dialog, showBtn;
var coll = false;
Ext.QuickTips.init(); <- fails b/c this code is executed before the document is completely loaded
return {
init : function(){
Ext.QuickTips.init(); <- this works b/c init() isn't called until the document is ready.
showBtn = Ext.get('show-dialog-btn');
showBtn.on('click', this.showDialog, this);
},

showDialog : function(){
if(!dialog){
.......
}
dialog.show(showBtn.dom);
}
};
}();

Ext.onReady(HelloWorld.init, HelloWorld, true);

schmidetzki
3 Apr 2007, 1:40 PM
Well the code I use is structured like this



<body>
<div></div>
...
<div></div>
<script>
Ext.onReady(function(){
...
Ext.QuickTips.init();
...
})
</script>
</body>

This should work, bc. Ext.onReady() ensures that document.body id "ready".
Please notice that quicktips work fine. I use a lot of quicktips in toolbar button and all tips are shown perfectly. But as soon as I show my "bad" dialog (triggered by one of the menu buttons) IE crashes. To be excactly: the dialog is show and IE crashes as soon as I move the mouse inside the dialog.
I found a workaround in the meantime: IE keeps alive when I put all text in the dialog inside tables (like I do in all other "good" dialogs). IE seems to crash only when text is rendered directly inside the dialogs body-div.

tryanDLS
3 Apr 2007, 1:50 PM
Try moving that block out of the body element and into the head. Script in the body works, but it's really not right, and may be causing a timing issue.

schmidetzki
4 Apr 2007, 9:10 AM
Try moving that block out of the body element and into the head. Script in the body works, but it's really not right, and may be causing a timing issue.

I do this because I have a splash screen "loading application ..." before loading ext.js like many examples have.

I also think that is not the correct direction to search for the problem.
QuickTips work fine. Everything is OK as long as I don't use this "bad" dialog. Therefore it doesn't seem to be a timing problem for me.

tryanDLS
4 Apr 2007, 10:27 AM
It is a timing issue if the document.body is not built yet. The point of the splash dialog is to display something while the body is begin built!

You can test this by setting a BP in QT.init. Step thru the creation of the Ext.Layer object - that constructor uses DomHelper to append an element to document.body. If the body isn't built yet, this fails.

On another note why do you need QuickTips for your splash page?

schmidetzki
4 Apr 2007, 11:42 PM
On another note why do you need QuickTips for your splash page?

I don't use QuickTips in the splash screen. The splash is shown before any ext-js in loaded. The splash does not use any Ext-Function (because it can't).

I call Ext.QuickTips.init() inside an Ext.onReady().
My understanding is, that Ext.onReady() ensures that the dom tree is build and everything is ready. What sence makes Ext.onReady() otherwise?

And again: The Ext.Layer is build correctly with not problems. The Layer is shown when I move the mouse over a ToolbarButton. Because of that it makes no sence to set a brakepoint inside init(). QuickTips.init() works fine.

kward
23 Apr 2007, 5:03 PM
My understanding is, that Ext.onReady() ensures that the dom tree is build and everything is ready. What sence makes Ext.onReady() otherwise?


I am having issues with Ext.onReady() as well. Specifically, when using the Prototype adapter I get intermittent Javascript Errors in IE (6 & 7) when using code similar to:

Ext.onReady(function(){
Ext.QuickTips.init();
});
});

IE blows up on an error within Prototype (PointerX()) indicating that the object (document) is not defined yet.

As a workaround, I started using Prototypes event as:

Event.observe(window, 'load', function() { buildForm(); });

This appears to have fixed the problem, but will need more testing. It does seem that Ext.onReady() has an issue, but I haven't looked into the difference between it and when Prototype is firing the load event.

prophet
24 Apr 2007, 6:58 AM
Very interesting. I'm having problems with IE7 and the Ext.QuickTips too.
Sometimes they load properly, sometimes they don't.
I'm not getting any "errors", but theres defiantly a problem.