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

Scheduler - Lazy loading data on

2 Answers 421 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Sam
Top achievements
Rank 1
Sam asked on 02 Nov 2018, 09:42 AM

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

2 Answers, 1 is accepted

Sort by
0
Accepted
Dimitar
Telerik team
answered on 06 Nov 2018, 12:23 PM
Hello Sam,

There is an existing example for ASP.NET MVC, where loading appropriate resources based on the navigated time range is demonstrated:


With the above example, once you navigate to another date/view the DataSource read will be successfully executed, thus retrieving the corresponding view records.
 
Regards,
Dimitar
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Sam
Top achievements
Rank 1
answered on 07 Nov 2018, 03:58 PM

Thanks very much Dimitar,

 

I was simply missing

 

ServerOperation(true)
Tags
Scheduler
Asked by
Sam
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Sam
Top achievements
Rank 1
Share this question
or