Datepicker refresh

Datepicker refresh


Hello,
First of all, let me say that jQuery is really awesome! And what about
the UI Datepicker, it is just amazing! Congratulations to all the
designers of this wonderfull solution.
I have been using jQuery UI Datepicker for few weeks now. I am at a
stage where I need to refresh it in my code.
Basically, I am displaying an inline Datepicker initialized with this
code :
jQuery('#date-pick').datepicker
({beforeShowDay:DaysOff,rangeSelect:true,numberOfMonths:2,inline:true,
rangeSeparator: ' au
',onSelect:updateInlineRange,minDate:"-1y",maxdate:"1y"});
jQuery('#date-pick').find('div:first').width(370);
When some actions are performed, I have an ajax call that updates the
filters (used in DaysOff). So I would need to refresh the Datepicker
displayed. Unfortunately, the only I have found to achieve this is to
destroy and recreate it :(
jQuery('#date-pick').datepicker('destroy');
jQuery('#date-pick').datepicker
({beforeShowDay:DaysOff,rangeSelect:true,numberOfMonths:2,inline:true,
rangeSeparator: ' au
',onSelect:updateInlineRange,minDate:"-1y",maxdate:"1y"});
jQuery('#date-pick').find('div:first').width(370);
The issue are the following :
1/ It is not clean at all to do this;
2/ Sounds like there are some leaks somewhere because the first time,
it works fine, the second as well but the third time, nothing gets
refreshed and I need to restart IE 6 to be able to make it work again
(the refresh through the destroy).
I am using ver 1.5.3.
Cheers!
Olivier