【发布时间】:2011-06-07 12:31:09
【问题描述】:
在我的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,如果用户单击工具栏而不是任何项目。
【问题讨论】: