We have implemented a scheduler on an mvc page:
01.
@(Html.Kendo().Scheduler<SchedulerBasicCore.Models.ScheduleViewModel>()
02.
.Name(
"scheduler"
)
03.
.Date(DateTime.UtcNow)
04.
.Editable(
false
)
05.
.Height(600)
06.
.Toolbar(t => t.Pdf())
07.
.AutoBind(
true
)
08.
.Views(views =>
09.
{
10.
views.DayView();
11.
views.WeekView(weekView => weekView.Selected(
true
));
12.
views.MonthView();
13.
views.AgendaView();
14.
})
15.
.Timezone(
"Etc/UTC"
)
16.
.DataSource(d => d
17.
.WebApi()
18.
.Model(m =>
19.
{
20.
m.Id(f => f.EventId);
21.
m.Field(f => f.Title).DefaultValue(
"No title"
);
22.
})
23.
.Read(read => read.Action(
"Schedules_Read"
,
"Scheduler"
).Data(
"getAdditionalData"
))
24.
)
25.
)
26.
27.
<script>
28.
function getAdditionalData() {
29.
var scheduler = $(
"#scheduler"
).data(
"kendoScheduler"
);
30.
31.
var result = {
32.
start: scheduler.view().startDate().toISOString(),
33.
end: scheduler.view().endDate().toISOString()
34.
}
35.
36.
return
result;
37.
}
38.
</script>
This calls through to an API and this all work successfully.
However, as i scroll through weeks or different views the api is called until some data is successfully returned. Once data is successfully returned no further changes of the views or scrolling through the dates result in an api call.
So I am wondering what I need to do to support loading data per view or date change?
Thanks
Sam