在我toolbar
那里checkbox
用于启用和禁用tooltip
. 如果checkbox
选中了,那么我应该启用tooltip
它并且它正在工作,如果没有,那么我应该禁用它也可以工作。禁用后tooltip
,当单击toolbar
未单击任何项目时,toolbar
它也处于启用状态。
toogleTooltip
是handler
一个checkbox
function toggleTooltip() {
debugger;
if (Ext.getCmp("msai_tool_tip").checked) {
Ext.QuickTips.enable();
while (!Ext.QuickTips.isEnabled())
Ext.QuickTips.enable();
} else {
Ext.QuickTips.disable();
while (Ext.QuickTips.isEnabled())
Ext.QuickTips.disable();
}
}
这是我的工具栏创建代码:
Ext.QuickTips.init();
var tb = new Ext.Toolbar({
id: 'form_menu_bar',
renderTo: Ext.get('newproducttitle').dom,
items: [{
tooltip: {
text: "Click on this button to generate the template and save it in server.",
title: "Save",
xtype: "quicktip"
},
iconCls: 'msai_save_template',
handler: generateTemplate
}, {
tooltip: {
text: "Click on this button to generate the template.",
title: "Save to clipboard",
xtype: "quicktip"
},
iconCls: 'msai_save_clipboard',
handler: generateTemplateClipboard
}]
});
tooltip
如果用户单击工具栏而不是任何项目,请提出一些解决方案,以便我不显示。