View Full Version : Ext.Window mouseover

16 Jun 2010, 6:21 AM
Could you please help me.
I try to implement this functionality
mouseover => window should be closed.
I make is so :

var toolTipWw = new Ext.Window({
html: 'some HTML',
id: 'ttID',
autoScroll: true,
constrain: true,
width: '35%',
title: 'title',
listeners: {
'render': function (w) {
w.getEl().on('mouseout', function(e) {
if(!e.within(w.getEl(), true)) {
}, this);
It's working fine. BUT. When I try to DRAG this window I get an error b.dom is undefined
What should I do?

16 Jun 2010, 6:43 AM
have some events that detect mousedown/mouseup

and then consider if the mousedown is active during the chunk:
w.getEl().on('mouseout', function(e) {
if(!e.within(w.getEl(), true)) {
}, this);

reason for this is because i THINK your render code is firing during both drag and mouseout??? so you want to ensure that it's not firing during the drag event, i think.

might be totally wrong. just a guess.

16 Jun 2010, 6:44 AM
Your mouseout function fires when you drag because the Window is replaces by a ghost as you can see.

And then, http://www.sencha.com/deploy/dev/docs/?class=Ext.Window&member=close

16 Jun 2010, 6:54 AM
Thanks, mr. Animal.
Could you please tell. Which solution of this problem exist ?

16 Jun 2010, 6:58 AM
Disable ghosting so that the actual Window element itself is dragged:

new Ext.Window({
title: 'Drag me',
height: 100,
width: 200,
ghost: function() {
return this.el;

16 Jun 2010, 7:12 AM
THANKS !!!!! A LOT !

16 Jun 2010, 8:20 AM
I have a new problem. When I drag my window very fast - I get a new error a is undefined

16 Jun 2010, 9:31 AM
Well don't use ext-all.js then, use ext-all-debug.js and see what is undefined and where and why by debugging.

17 Jun 2010, 5:46 AM
mr. Animal, thank you.
I debugged it. And I have got next situation :
I click on my window, drag it, then if I very fast move mouse out of the window. I get an error :

style is undefined
style.left = me.addUnits(left);
ext-all-debug.js (line 4931)

17 Jun 2010, 5:48 AM
And when you set a break there, why is that happening?

17 Jun 2010, 5:51 AM
because, in the code (line 4931 in the ext-all-debug.js) style is undefined

setLeftTop : function(left, top){
var me = this,
style = me.dom.style;
style.left = me.addUnits(left);
style.top = me.addUnits(top);
return me;

17 Jun 2010, 5:55 AM
me.dom.style is undefined?

So what is me.dom, therefor what is me (ie "this").

Go back through the call stack to see what object setLeftTop is being called upon and why..... blah blah.... debug basically.

17 Jun 2010, 6:16 AM
ok, thank you very much !!!