【问题标题】:button tooltip extjs按钮工具提示 extjs
【发布时间】:2010-12-08 13:44:48
【问题描述】:

我通过调用在中心区域的标签面板中添加了一个按钮

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('Please highlight the correct value and click Add to create new internalcontact'); 如果点击内部客户端。 add.setToolTip('Please highlight the correct value and click Add to create new external contact'); 点击外部时。

【问题讨论】:

  • 您能否改写一下或提供更多信息?很难确定您是否在这里提出问题。

标签: button extjs tooltip extjs3


【解决方案1】:

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

Ext.QuickTips.init();

并使用 qtip 代替 tooltip。

【讨论】:

  • 如果您在整个应用程序中使用 QuickTips,您会将其放入哪个文件中?
  • 为什么是Ext.QuickTips.init(); 而不是Ext.tip.QuickTipManager.init();
  • ExtJS3 的答案是 5 年前发布的,最新版本是 ExtJS6。我不再使用 ExtJS。
  • 请告诉我的雇主。
【解决方案2】:

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

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

【讨论】:

    【解决方案3】:

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

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-02-01
      • 1970-01-01
      • 2014-10-09
      • 1970-01-01
      • 2012-04-19
      • 1970-01-01
      相关资源
      最近更新 更多