button tooltip extjs

EXTJS newbie picture EXTJS newbie · Dec 8, 2010 · Viewed 22k times · Source

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.

Answer

Jan Vladimir Mostert picture Jan Vladimir Mostert · Jan 11, 2011

You need to initialise tooltips for it to work:

Ext.QuickTips.init();

And use qtip instead of tooltip.