I want to show an ExtJS ToolTip as the result of a button click. When the User clicks the "X" or clicks the button a 2nd time the ToolTip should disappear (note I did not say "hidden"). If the user clicks the button a third time the Tip should show up again.
My problem is that if you hover over the button, the ToolTip shows up. (See fiddle) I only want it as a result of a button click.
I have tried calling "remove()" on the component to remove it from the DOM in the "onbeforeclose()" and "beforehide()" events but the Tip still shows up on hover.
I also want to note that calling the "close()" method from the documentation does not actually trigger the "onbeforeclose()" event - which doesn't really make sense to me...
すべての Sencha の例では、ホバー時にヒントが表示されます。クリックイベントの後にのみヒントを表示することさえ可能ですか?
フィドルのコードは次のとおりです。
function onClick() {
window.Ext.create('Ext.tip.ToolTip', {
target: 'div123',
html: 'I am a tip',
autoShow: true,
autoScroll: true,
focusOnToFront: true,
autoHide: true,
closable: true
});
}
window.Ext.create('Ext.Button', {
id: 'btn123',
renderTo: 'div123',
text: 'click me',
width: '100px',
handler: onClick
});
また、ボタンをクリックするたびに新しいツールヒントを作成していることを認識していることにも言及したいと思います。私は認識しており、それは望ましい動作です。私の問題は、クリックするたびに新しいヒントを表示することです。ホバー時に古いヒントを表示するのではありません。