Brian
Brian

Reputation: 21

remove plugun instance

I am using jquery.timepickr.js. I want to be able to change the parameters, something like:

$('aField').timepickr( some default parameters);

User makes some choices:

$('aField').remove(timepickr);
$('aField').timepickr(some_other_parameters_reflecting_user_choices);

How can I destroy/unlink/remove/disassociate an instance of timepickr?

I have also tried $('aField').timepickr('destroy');

Upvotes: 2

Views: 805

Answers (1)

Nick Craver
Nick Craver

Reputation: 630439

Their destroy function is not correctly cleaning up, as a work-around, try this:

$('aField').timepickr('destroy').next(".ui-timepickr").remove(); //Blow it away
$('aField').timepicker(); //Bring it back, new options

Only change is we're cleaning up the elements it creates after destroying the widget itself.

Upvotes: 3

Related Questions