JQuery UI datepicker: comment lier un événement APRÈS le calendrier a été rendue?

Je suis en utilisant datepicker. La façon habituelle de lier un événement, disons par exemple, beforeShowDay, serait:

$('.selector').datepicker({
   beforeShowDay: function(date) { ... }
});

Ce dont j'ai besoin est de se lier à la beforeShowDay événement après le calendrier a été rendu. Alors, disons que j'ai d'abord rendu le calendrier:

$('.mySpecialContainer').datepicker({
   //in this moment, for some reason, I am not allowed to bind nothing (that's not me who renders the calendar, that's why I am not allowed)
});

Et puis, si j'essaie de lier quelque chose dans la manière habituelle:

$('.mySpecialContainer').datepicker({
   beforeShowDay: function(date) { ... }
});

Le calendrier sera - bien sûr - rendu de nouveau à l'intérieur de '.mySpecialContainer', au lieu de simplement la liaison de l'événement. J'ai essayé:

$('.mySpecialContainer').bind('beforeShowDay', function(date) { ... });

Mais c'était juste une tentative désespérée d'action 🙂

OriginalL'auteur bluefoot | 2011-03-05