如何在对extjs中元素的鼠标悬停打开新工具提示之前关闭未关闭的旧工具提示?
是否有类似clearoldtooltips选项的内容?
答案 0 :(得分:0)
使用小提琴:https://fiddle.sencha.com/#fiddle/1hud
Ext.create('Ext.button.Button', {
text: 'hello',
width: 100,
height: 40,
renderTo: Ext.getBody(),
listeners: {
render: function() {
var me = this;
me.fireEvent('mouseover');
},
mouseover: function() {
// Recreate ToolTip on Hover
var me = this;
var tip = Ext.create('Ext.tip.ToolTip', {
target: me.id,
html: 'loading...',
listeners: {
show: function(eOpts) {
console.log('Create toolTip');
this.setHtml('ToolTip');
},
hide: function() {
setTimeout(function() {
console.log('destroy toolTip');
tip.destroy();
}, 2000);
}
}
});
}
}
});