Really like datepicker. Thanks a lot for this great library!
I have got one question for you based in this example (inline datepicker):
http://www.kelvinluck.com/assets/jquery/datePicker/v2/demo/datePickerMultiMonth5.html
I added a "renderCallback" function to disable week days based on checkboxes... (e.g. when saturday-checkbox is checked disable all saturdays shown).
This works perfectly fine when initializing the calender with datePickerMultiMonth().
But how can I refresh the inline calender when one of the checkboxes is changed (e.g. deselect monday-checkbox)?
As-is: when I select / deselect a checkbox the datepicker remains unchanged.. only after manually changing to the next month it updates and disables e.g. all mondays... this should immediately happen when changing the monday-checkbox.
Do you have any idea how I can refresh the datepicket? Thanks a lot for your help!
Cheers, Markus
.datepicker( "refresh" )
You can find it on http://jqueryui.com/demos/datepicker/#method-refresh click the "Methods" tab
Probably the easiest way to solve the problem is to remove the existing calendar and then rerender it. e.g.:
$mm.empty().datePickerMultiMonth({});
However, this has some drawbacks as the state of your date picker isn't maintained (e.g. displayed month, selected dates etc).
So I just made some changes to the plugin and introduced a new method: dpmmRerenderCalendar
on the multimonth picker (and the corresponding dpRerenderCalendar
on the date picker itself).
You can see an example of it in action here:
http://www.kelvinluck.com/assets/jquery/datePicker/v2/demo/datePickerMultiMonth7.html
And can grab the latest plugin code from my site or the googlecode repository.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With