Hi Oliver,
Try this:
jQuery("#date-pick").datepicker("setDate",jQuery("#date-
pick").datepicker("getDate"));
Essentiall this sets the date to the currently selected date. Its not
elegant, but its a better option than destroying the datepicker.
Hope this helps,
Lewis
On Jan 8, 6:37 pm, Olivier <[email protected]> wrote:
> 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
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"jQuery UI" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/jquery-ui?hl=en
-~----------~----~----~----~------~----~------~--~---