I'm using tooltips from Twitter Bootstrap package to show items information on the page. Sometimes information is changed, and needs to be updated in the tooltip. I tried simply to reinitialize tooltip with new title:
$('#selector').tooltip({ title: 'new text'});
However tooltip's title doesn't get changed with the new text. It remains the same as it was set initially. Any ideas why, and is there any work around? Thanks!
Useful if you need to change a tooltip's text after it has been initialized: $(this). tooltip('hide') . attr('data-original-title', 'new text') .
Drag the calculated field to the appropriate tooltip and you'll see an ATTR dimension pill with a tooltip logo in the Marks card. Insert the ATTR budget and adjusted inflated gross calculated fields into its corresponding tooltip as seen in Image 6. After that, you're dynamic tooltip should work!
You can't override the tooltip object once you have initialized it on one element. But you can delete it and do it again.
Try deleting and then reinitialize the tooltip with all your options (if you had any).
$('#selector').data('bs.tooltip',false) // Delete the tooltip
.tooltip({ title: 'new text'});
There may be a need to remove the listeners, but it works like that.
Before TWBS v3 you would not need the bs
namespace giving : data('tooltip')
This technique did not work for me so I found an answer, hidden in one of the comments of a similar question.
the cleanest way to update the display text of the tooltip
$(element).attr('title', 'NEW_TITLE').tooltip('fixTitle').tooltip('show');
Thank you to lukmdo
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With