按钮工具提示 extjs

发布于 2024-10-07 06:37:53 字数 533 浏览 0 评论 0原文

中心区域的选项卡面板中添加了一个按钮

var add = tabSelection.addButton({
  id            : 'add',
  text          : 'Add',
  hidden        : true,
  tooltip       : 'Please highlight the correct value and click Add to create new contact',
  handler       : addContact
});

我通过调用在手风琴布局中的西部区域有两个单选按钮,在 ,标记为“内部”和“外部”。我希望通过捕获单选按钮单击来动态更改工具提示。

我能够捕获单选按钮单击,当我相应地设置按钮的工具提示时, add.setToolTip('请突出显示正确的值并单击“添加”以创建新的内部联系人'); 如果单击内部客户端。 add.setToolTip('请突出显示正确的值并单击“添加”以创建新的外部联系人'); 当单击外部时。

I have added a button to a tab panel in the center region by calling

var add = tabSelection.addButton({
  id            : 'add',
  text          : 'Add',
  hidden        : true,
  tooltip       : 'Please highlight the correct value and click Add to create new contact',
  handler       : addContact
});

There are two radio buttons in the west region in an accordion layout, labeled 'internal' and 'external'. I want the tool tip to be changed dynamically by capturing the radio button click.

I am able to capture the radio button click and when I set the tooltip of the button accordingly,
add.setToolTip('Please highlight the correct value and click Add to create new internalcontact'); if internal client is clicked.
add.setToolTip('Please highlight the correct value and click Add to create new external contact'); when external is clicked.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

行至春深 2024-10-14 06:37:53

您需要初始化工具提示才能使其工作:

Ext.QuickTips.init();

并使用 qtip 而不是工具提示。

You need to initialise tooltips for it to work:

Ext.QuickTips.init();

And use qtip instead of tooltip.

半仙 2024-10-14 06:37:53

也为我工作(在 ExtJS 4.1 上):

Ext.getCmp('buttonId').setTooltip('Tooltip you want to insert');

Also worked for me (on ExtJS 4.1):

Ext.getCmp('buttonId').setTooltip('Tooltip you want to insert');
过气美图社 2024-10-14 06:37:53

另一种不使用 id 的解决方案,例如使用按钮工具提示:

 var prev_button = new Ext.button.Button({
            cls: 'prevButton',
            listeners: {
                mouseover: function(btn) {
                    btn.setTooltip('1 ' + granularity.getValue()
                                   + ' ' + _('before'));
                }
            }
        });

Another solution without using id, for e.g. with a button tooltip:

 var prev_button = new Ext.button.Button({
            cls: 'prevButton',
            listeners: {
                mouseover: function(btn) {
                    btn.setTooltip('1 ' + granularity.getValue()
                                   + ' ' + _('before'));
                }
            }
        });
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文