[英]how to add tooltip to widget in extjs?
我在extjs中有一個動態表單,我想在表單的某些元素中添加工具提示。
widget = {
width: 100,
title: name,
margin: '0 0 0 0',
id: id
}
我要添加工具提示的小部件。
我已經嘗試將偵聽器添加到小部件,但是沒有用
listeners: {
render: function(c) {
Ext.create('Ext.tip.ToolTip', {
target: c.getEl(),
html: c.tip
});
}
}
多數民眾贊成在我已經嘗試過的。
提前致謝。
listeners : {
render: function(p) {
var theElem = p.getEl();
var theTip = Ext.create('Ext.tip.Tip', {
html: name,
margin: '0 0 0 200',
shadow: false
});
p.getEl().on('mouseover', function(){
theTip.showAt(theElem.getX(), theElem.getY());
});
p.getEl().on('mouseleave', function(){
theTip.hide();
});
}
}
我找到了解決方案,添加了此偵聽器可幫助我添加工具提示
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.