setting the option after init solved the problem. thank you


On 18 Aug., 21:46, Jörn Zaefferer <[email protected]>
wrote:
> As a workaround, you could set that option after init:
>
> $('#options #date').datepicker({
>        minDate: 0,
>        maxDate: "+2Y",
>        regional: $('html').attr('lang'),
>        changeMonth: true,
>        changeYear: true,
>        showOtherMonths: true,
>        hideIfNoPrevNext: true,
>        dateFormat: 'yy-mm-dd',
>        defaultDate: new Date($('ul.events li:first span.date').attr
> ('title')),
>        beforeShowDay: highlightEventDates,
>        onSelect: showEventsOnDate
>
> }).datepicker("option", { onChangeMonthYear: showEventsFromMonth });
>
> If that doesn't work, set a flag in the function to check if its the
> first time that its invoked, and ignore that.
>
> If the issue remains, please file a 
> ticket:http://dev.jqueryui.com/newticket(requires login/registration)
>
> Jörn
>
> On Tue, Aug 18, 2009 at 5:21 PM, Matthias<[email protected]> 
> wrote:
>
> > hi,
>
> > i have an inline datepicker with the following options:
>
> > $('#options #date').datepicker({
> >        minDate: 0,
> >        maxDate: "+2Y",
> >        regional: $('html').attr('lang'),
> >        changeMonth: true,
> >        changeYear: true,
> >        showOtherMonths: true,
> >        hideIfNoPrevNext: true,
> >        dateFormat: 'yy-mm-dd',
> >        defaultDate: new Date($('ul.events li:first span.date').attr
> > ('title')),
> >        beforeShowDay: highlightEventDates,
> >        onSelect: showEventsOnDate,
> >        onChangeMonthYear: showEventsFromMonth
> > });
>
> > The problem:
>
> > it seems like the onChangeMonthYear event is fired inmediatly as the
> > page loads, not only when the dropdown is changed. my function
> > showEventsFromMonth() changes the window.location.href and now the
> > page always will be reloaded.
>
> > to make it clear, i want to change the window.location.href, when the
> > user changes the month or the year dropdown in the datepicker, not
> > when the page loads.
> > Does anybody have an idea how to achieve this?
>
> > thanks
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to