How to ignore certain events

2 posts, 0 answers
  1. Gilbert
    Gilbert avatar
    5 posts
    Member since:
    Jul 2012

    Posted 07 Aug 2012 Link to this post

    Hi,

    I want to perform an ajax call only when next and previous navigation happens.
    How can i get a handle on these events?

    I get the month and year like this but how can i tell if the user is navigating forward or back a month?
    var month = this._current.getMonth() + 1;
    var year = this._current.getFullYear();

    .Events(events => events 
                                            .Change("goToDate")
                                            .Navigate("goToMonth"))

    Thank you.
  2. Gilbert
    Gilbert avatar
    5 posts
    Member since:
    Jul 2012

    Posted 07 Aug 2012 Link to this post

    Also, i've noticed that when i do an ajax call on navigate, i have to supply a value to the Calendar control or it always defaults back to the current month.

    <%= Html.Kendo().Calendar()
                        .Name("DatePicker")
                        .Min(Model.MinDate)
                        .Max(Model.MaxDate)
                        .Value(Model.CurrentDate)
                        .HtmlAttributes(new { style = "width:70%; height: 350px;" })
                        .Events(events => events 
                                            .Change("goToDate")
                                            .Navigate("goToMonth"))
                        .MonthTemplate("#  if ($.inArray(+data.date, events) != -1) { #" +
                                    "<div class=\"eventFound\">#= appointments[$.inArray(+data.date, events)][1] #</div>" +
                        "# } #" +
                        "#= data.value #")     
        %>
  3. Kendo UI is VS 2017 Ready
Back to Top