PDA

View Full Version : Cannot set QuickTips dismissDelay to 0



lsaffre
25 Feb 2012, 3:58 PM
It seems this is a bug in ExtJS 3.3.1, 3.4 and maybe also in 4.0.
I didn't yet test in other versions because of other unrelated problems.

Here is how I (try to) set dismissDelay=0 for all QuickTips::


Ext.QuickTips.init();
// Apply a set of config properties to the singleton
Ext.apply(Ext.QuickTips.getQuickTip(), {
dismissDelay: 0
});


I register all QuickTips using the following function::


Lino.quicktip_renderer = function(title,body) {
return function(c) {
var t = ;
Ext.QuickTips.register({
target: c.getEl(),
dismissDelay: 0,
title: title,
text: body
});
}
};




The above code does not change the dismissDelay. Tooltips continue to hide away automatically after 5 seconds, Here is how I worked around this. I changed one line in Ext.QuickTip.showAt() of `ext-all-debug.js`::





showAt : function(xy){
var t = this.activeTarget;
if(t){
...
this.autoHide = t.autoHide;
// bugfix by Luc 20120226
if (t.dismissDelay != undefined) this.dismissDelay = t.dismissDelay;
//~ this.dismissDelay = t.dismissDelay || this.dismissDelay;
// end of bugfix by Luc 20120226
if(this.lastCls){
...


if (t.dismissDelay != undefined) this.dismissDelay = t.dismissDelay;
//~ this.dismissDelay = t.dismissDelay || this.dismissDelay;




In `ext-all.js` you must search for::



this.dismissDelay=a.dismissDelay||this.dismissDelay;

and replace it with::


if(t.dismissDelay!=undefined)this.dismissDelay=t.dismissDelay;



Note that this workaround still doesn't help for setting the default (singleton) config.
But at least it now works when specifying dismissDelay in register().