javascript - 如何在运行时更改 Ext Js 按钮工具提示?

标签 javascript button extjs tooltip

我有以下内容:

var panel = headerPanel.add({
    id: 'recentcommands_button_id',
    xtype: 'button',
    text: "Recent Commands",
    tooltip: "Sample Tooltip Text"
}); 

随后是:

Ext.getCmp('recentcommands_button_id').tooltip = "TEST";

如果我检查按钮的属性,它会正确设置工具提示值,但实际上不会更改屏幕上的值。

我尝试使用:

Ext.getCmp('recentcommands_button_id').tooltip.update("TEST");

这也不起作用。

有什么想法吗?

最佳答案

您可以使用setTooltip方法:

Ext.getCmp('recentcommands_button_id').setTooltip("TEST");

关于javascript - 如何在运行时更改 Ext Js 按钮工具提示?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25672195/

相关文章:

angular - 如何使用函数设置禁用按钮属性?

javascript - 如何让 Container 中的多个组件继承 Container 的计算宽度?

javascript - 如何更改 ExtJS 中组合框的值

javascript - 如何将 broccoli-compass 添加到 ember-cli v0.0.28?

javascript - 在 AngularJS 中解析 JSONP 文件

javascript - HTML/CSS 复选框文本与 <span> 或 <div> 对齐

Android:当我动态添加新的 ListView 条目时,ListView 中的 Spinners 会丢失它们的值

javascript - 我的简单计算器无法运行。我想在按钮单击事件上使用事件监听器

ios - 如何制作自定义形状的按钮?