如何将工具提示添加到 extjs 中的小部件?
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();
});
}
}
我找到了解决方案,添加这个监听器帮助我添加工具提示
我在 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();
});
}
}
我找到了解决方案,添加这个监听器帮助我添加工具提示