I'm trying to use the jquery ui datepicker as an event calendar, which
requires some differences from what is currently available. I have it
almost completed but I'm running into one dead end.
The way I am modding the widget is to allow it to generate itself as
normal, and then going over the html with my own code and changing or
adding things to how I need them to be. The issue is that the html is
regenerated every time the user clicks to advance or go back a month,
so I need to run my code again on the newly displayed month.
I tried using the onChangeMonthYear to option to trigger my code, but
unfortunately it is set up in such a way that whatever function I bind
to that event gets fired before the new html is generated by the
datepicker code, effectively wiping my updates.
I looked through the code and found that the onChangeMonthYear event
is getting called by the _notifyChange method, here is the code snip
from the development version:
804 _selectMonthYear: function(id, select, period) {
805 var target = $(id);
806 var inst = this._getInst(target[0]);
807 inst._selectingMonthYear = false;
808 inst['selected' + (period == 'M' ? 'Month' :
'Year')] =
809 inst['draw' + (period == 'M' ? 'Month' : 'Year')]
=
810 parseInt(select.options
[select.selectedIndex].value,10);
811 this._notifyChange(inst);
812 this._adjustDate(target);
813 },
Hopefully the spacing for that is maintained... if it isn't, the
important part is that this._notifyChange(inst); is called, followed
by this._adjustDate(target);. I need to call _adjustDate first. It
looks like it would not cause a problem for me to call that method
from onChangeMonthYear (and therefore effectively from _notifyChange),
and still have the function called later.
I don't want to change the existing jqueryui code so my changes are
maintained across version updates.
Does anyone know the line of code that would be necessary to manually
call _adjustDate, or if it is even possible? it appears that the
parameter is the element of the current datepicker itself, which is
trivial to get from inside my own code.
Thanks,
Kevin
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---