You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Sebastien <se...@gmail.com> on 2013/10/22 13:37:25 UTC

Re: jquery.ui.calendar.Calendar disable next button

Hi,

As far as I see, there is no such options. (I would had expected a
'minDate' options, but seems to not be the case...).
The only way I see, is to add a javascript statement which will
display/hide the "button". Actually, these are not real buttons (but spans,
so it is harder to "disable" these than showing/hiding).


            @Override
            public boolean isViewRenderEnabled()
            {
                return true;
            }

            @Override
            public void onViewRender(AjaxRequestTarget target, CalendarView
view)
            {
                super.onViewRender(target, view);

                String statement = String.format("var date =
$('%s').fullCalendar('getDate');", JQueryWidget.getSelector(this));
                statement += "var minDate = new Date(date.getFullYear(),
date.getMonth(), 1, 0, 0, 0, 0);";
                statement += "if (minDate < new Date()) {"; //TODO replace
'new Date()' by the wished date
                statement += "    $('.fc-button-prev').css('display',
'none');";
                statement += " } else { ";
                statement += "    $('.fc-button-prev').css('display',
'inline-block');";
                statement += " }";

                target.appendJavaScript(statement);
            }


Hope this helps,
Sebastien.


On Tue, Oct 22, 2013 at 11:13 AM, Selom <pi...@uhb.fr> wrote:

> Hello;
> Need your help again .
> I 'd like  to disable the next buton when moving  the calendar one step
> forward at my  specified date let say 31 december.
> I there any *option * to do that ?
> Thanks in advance.
>
>
>
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/jquery-ui-calendar-Calendar-disable-next-button-tp4661918.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: jquery.ui.calendar.Calendar disable next button [SOLVED]

Posted by Selom <pi...@uhb.fr>.
I did not see the 2 methods  onViewRender and isViewRenderEnabled but  I saw
*isViewDisplayEnabled *and  *onViewDisplay  *in the ICalendarListener.
I override them with the your code above.
wonderful .
It  works nicely ...

Thank you again .



--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/jquery-ui-calendar-Calendar-disable-next-button-tp4661918p4661920.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org