开发者

button tooltip extjs

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 th开发者_如何学运维e 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.


You need to initialise tooltips for it to work:

Ext.QuickTips.init();

And use qtip instead of tooltip.


Also worked for me (on ExtJS 4.1):

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


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'));
                }
            }
        });
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜