Originally Posted by
Rod
In fact, it doesn't, sry -_-
I was so happy that it didnt disappear I didn't try to move my mouse.
The tooltip doesn't disappear when the mouse leaves the underlying element.
In fact it acts like a closeable tooltip, but without the cross to close it.
Any clue how to make the tooltip disappear when the cursor leaves the element?
My solution is to override the Ext.QuickTip class.
I'm using ext-3.4.0.
I added dismissDelay property (at 0 like default value), I added the tag: dismissDelay : "qdmDelay" so I'm able to use it in html in the same as the other
and I override the onTargetOver function with a little modify, I'had added the assignement of the new tag value in the activeTarget (dismissDelay: et.getAttribute(cfg.dismissDelay, ns))
Maybe isn't the better way, there are much more OOP way to write it, but it works fine :)
Ext.override(Ext.QuickTip, {
dismissDelay: 0,
tagConfig : {
namespace : "ext",
attribute : "qtip",
width : "qwidth",
target : "target",
title : "qtitle",
hide : "hide",
dismissDelay : "qdmDelay",
cls : "qclass",
align : "qalign",
anchor : "anchor"
},
onTargetOver: function(e){
if(this.disabled){
return;
}
this.targetXY = e.getXY();
var t = e.getTarget();
if(!t || t.nodeType !== 1 || t == document || t == document.body){
return;
}
if(this.activeTarget && ((t == this.activeTarget.el) || Ext.fly(this.activeTarget.el).contains(t))){
this.clearTimer('hide');
this.show();
return;
}
if(t && this.targets[t.id]){
this.activeTarget = this.targets[t.id];
this.activeTarget.el = t;
this.anchor = this.activeTarget.anchor;
if(this.anchor){
this.anchorTarget = t;
}
this.delayShow();
return;
}
var ttp, et = Ext.fly(t), cfg = this.tagConfig, ns = cfg.namespace;
if(ttp = this.getTipCfg(e)){
var autoHide = et.getAttribute(cfg.hide, ns);
this.activeTarget = {
el: t,
text: ttp,
width: et.getAttribute(cfg.width, ns),
autoHide: autoHide != "user" && autoHide !== 'false',
title: et.getAttribute(cfg.title, ns),
cls: et.getAttribute(cfg.cls, ns),
align: et.getAttribute(cfg.align, ns),
dismissDelay: et.getAttribute(cfg.dismissDelay, ns)
};
this.anchor = et.getAttribute(cfg.anchor, ns);
if(this.anchor){
this.anchorTarget = t;
}
this.delayShow();
}
}
});