AngryLeo
AngryLeo

Reputation: 400

Extjs 6: How to forcefully show a tooltip on an element on a button click?

I have a scenario i.e.combobox and a button. I want to show a tooltip on combox when I click on a button and hide it when i click again. How do I do that without using ids on tooltip instance? Also can I specify the position of tooltip i.e x and y relative to combobox and style tooltip a little bit? Thanks a lot

Upvotes: 1

Views: 1221

Answers (1)

Tejas
Tejas

Reputation: 902

When you click on button create new tooltip instance as below:

Ext.create('Ext.tip.ToolTip', {
    html:<tip contents>,
    id:<some id>
});

And showBy() this instance for that combo like tip.showBy(<combo instance>). Now again you click on button you check if tip instance is present, if yes then hide it else show it again. But you will need some id for tooltip.

Upvotes: 3

Related Questions