This is a migrated thread and some comments may be shown as answers.

How to ignore certain events

1 Answer 25 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Gilbert
Top achievements
Rank 1
Gilbert asked on 07 Aug 2012, 04:00 PM
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.

1 Answer, 1 is accepted

Sort by
0
Gilbert
Top achievements
Rank 1
answered on 07 Aug 2012, 04:24 PM
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 #")     
    %>
Tags
Calendar
Asked by
Gilbert
Top achievements
Rank 1
Answers by
Gilbert
Top achievements
Rank 1
Share this question
or