Monday, June 3, 2024
 Popular · Latest · Hot · Upcoming
15
rated 0 times [  18] [ 3]  / answers: 1 / hits: 16107  / 14 Years ago, wed, february 2, 2011, 12:00:00

I am using Flowplayer's jQuery Tools framework (specifically the tooltips plugin) in a table, in addition to jQuery UI calendar.



Each row of the table has the ability to insert a row above and below it.



When doing this I am cloning the clicked object (events and objects) and inserting it directly above or below.



After adding a new row, I refresh the table, generating new id's for my elements, reinitializing the datepicker, and attempting to reinitialize the tooltip.



I am searching for a way to destroy it altogether from the instance and reapply it.



I am looking for something similar to the datepicker('destroy') method.



$j($editRow).find('input.date').datepicker('destroy').datepicker({dateFormat: 'mm-dd-yy', defaultDate : defaultDateStr});



I have already attempted to :




  1. to unbind the mouseover and focus events : when reinvoking tooltip, it automatically goes for the object it was made from.


  2. hide the tooltip DOM element, remove the tooltip object from the target, and reapply it. The same thing happens as (1)




Is there way I can create a destroy method myself?


More From » jquery

 Answers
18

I tried kwicher's method, and could not get it to work. Although I was trying to alter the minified code, and I'm not entirely sure I found the right place to make the change.



I did, however, get this to work. ValidationFailed is a class I am applying to all the input fields that are also having tooltips applied to them.



$('.validationFailed').each(function (index) {
$(this).removeData('tooltip');
});

$('.tooltip').remove();


I tried this several different ways, and this was the only combination that allowed me to add additional tool tips post-removal, without preventing the new tooltips from working properly.



As best I can tell, the tooltip class removal handles getting rid of the actual tooltip divs, whose events are also wired up directly. The .removeData allows the tooltip to be re-bound in the future.


[#93928] Tuesday, February 1, 2011, 14 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
aleenamarinr

Total Points: 610
Total Questions: 109
Total Answers: 118

Location: Mayotte
Member since Mon, Sep 12, 2022
2 Years ago
;