Nevermind. I figured it out. Just in case anyone's wondering how to alter
the HTML of the datepicker after each time it reloads with a new month
here's how:
First define an event handler for the onChangeMonthYear event:
onChangeMonthYear: function(date)
{
//run your code here
}
But this will only fire correctly when you select the new month/year from
the dropdown boxes. If you try to change the month using the next/prev
buttons then the event will fire before the new HTML has loaded, so any
changes you make to the HTML will be to the old HTML that is about to get
changed by the datepicker code. To change this I overrided the _adjustDate
function that gets executed when you click the next/prev buttons:
jQuery.datepicker.oldAdjustDate = jQuery.datepicker._adjustDate;
jQuery.datepicker._adjustDate = function(id, offset, period)
//overriding a datepicker core function
{
this.oldAdjustDate(id, offset, period); //to ensure that the old
code still runs
this._notifyChange($.datepicker._curInst); //this ensures that
the onChangeMonthYear event is fired correctly
}
This way the _notifyChange function gets called after the adjustDate code
finishes and then the onChangeMonthYear successfully gets fired after the
new HTML changes.
On Fri, Oct 31, 2008 at 7:55 AM, Adam Schmitz <[EMAIL PROTECTED]> wrote:
> I'm trying to execute a block of code everytime the HTML in the datepicker
> changes. In other words this event should fire off when month or year is
> changed but after jQuery has loaded in new HTML for the calendar. I know
> there's a "changeMonthYear" event but that event gets called before the new
> HTML has been loaded. Ultimately I'm just trying to be able to alter the
> HTML everytime the month changes. Any thoughts?
>
>
> --
> Adam
>
> "Do one thing, and do it well."
> -- The UNIX Philosophy
>
--
Adam
"Do one thing, and do it well."
-- The UNIX Philosophy
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---