jQuery ui - datepicker prevent refresh onSelect

I'm using jQuery ui Datepicker to display a yearly inline calendar full of "special dates" (with colors). enter image description here This is to allow users to batch special dates by selecting a range and some other details.

$('#calendar').datepicker({
  ...
  , onSelect: function (selectedDate, inst) {
      $('.date_pick').toggleClass('focused');
      if ($('.date_pick.end').hasClass('focused')) {
        $('.date_pick.end').val('');
      }
      # inst.preventDefault() ? <- not a function
      # inst.stopPropagation() ? <- not a function
      # return (false) ? <- calendar refreshes anyway
    }
  ...
});

I'm also using qtip to show the details on each date

My problem is when I click on the calendar, it reloads itself entirely, so I loose my qtips.

I'd prefer not to use live() with qtip because I don't like the behavior.

I'd also prefer that the calendar not refresh each time I click on it (but this does not seem possible anyway) but I would probably no longer be able to highlight my selection anymore.

Do you have a suggestion for my problems ?

10
задан Pierre de LESPINAY 19 May 2011 в 09:10
поделиться