Ahm*_*med 3 javascript extjs tooltip
我正在尝试向我的按钮添加工具提示,我尝试了不同的方法,但是当我将鼠标放在按钮下时没有任何反应,这是我的代码的一部分,当我尝试添加此工具提示时,我创建了按钮guestButton
{
xtype : 'button',
id : 'guestButton',
text : 'Guest User',
handleMouseEvents: true,
width : 80,
x : 70,
y : 150,
formBind : false,
handler : function() {
this.up().LoginGuest();
}
Run Code Online (Sandbox Code Playgroud)
在这里,当我试图创建工具提示
var tooltips = [{
target: 'guestButton',
html: 'A very simple tooltip'
}];
Ext.each(tooltips, function(config) {
Ext.create('Ext.tip.ToolTip', config);
});
Ext.QuickTips.init();
Run Code Online (Sandbox Code Playgroud)
谢谢 !
您应该能够使用以下命令为 ExtJS 中的按钮定义工具提示:
xtype : 'button',
id : 'guestButton',
text : 'Guest User',
tooltip: 'A very simple tooltip',
Run Code Online (Sandbox Code Playgroud)
如果您的按钮被禁用,则工具提示将不会显示。这是设计使然,但如果需要,可以使用一些 CSS 覆盖它:
.x-item-disabled, .x-item-disabled * {
pointer-events:all;
}
Run Code Online (Sandbox Code Playgroud)
请参阅此处的小提琴。
在渲染时添加工具提示的另一种方法.
@chrisuae是对的,但它对我也没有用.
有用的是在元素渲染上创建工具提示:
{
xtype : 'textareafield',
grow : true,
fieldLabel : 'E-Mail-Adressess'
itemId : 'email',
afterLabelTextTpl : required,
allowBlank : false,
listeners : {
render: function(c) {
Ext.create('Ext.tip.ToolTip', {
target: c.getEl(),
html: 'You can enter multiple emails here'
});
}
}
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1696 次 |
| 最近记录: |