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

The scheduler is not displaying events

1 Answer 526 Views
This is a migrated thread and some comments may be shown as answers.
Top achievements
Rank 1
jon asked on 30 Jul 2014, 03:53 AM
I think I am going loopy, because this should be working. I've tried every possible way of instantiating a scheduler widget. I can get the widget to return events if I use the MVC wrapper or even a straight copy and paste of the demo's using the jsonp data type.

But do you think i can get the json data type to work. Here is my code thus far.

var dsSchedule = new{
transport: {
         read: {
            url: '/api/Schedule/JobBoard',
            dataType: 'json',
      schema: {
         model: {
            id: 'taskId',
            fields: {
               taskId: { from: "TaskID", type: "number" },
               title: { from: "Title", defaultValue: "No title", validation: { required: true } },
               start: { type: "date", from: "Start" },
               end: { type: "date", from: "End" },
               description: { from: "Description" },
               recurrenceId: { from: "RecurrenceID" },
               recurrenceRule: { from: "RecurrenceRule" },
               recurrenceException: { from: "RecurrenceException" },
               isAllDay: { type: "boolean", from: "IsAllDay" }

      date: new Date(),
      startTime: new Date(),
      height: 600,
      views: ["day", { type: "workWeek", selected: true }, "week", "month", "agenda"],
      dataSource: dsSchedule

If directly tried setting the dataSource as the widget is instantiated or later as per the following

var scheduler = $("#scheduler").data("kendoScheduler");

Both methods trigger the SchedulerDataSource to fetch the data

AggregateResults: null
Data: [,…]
Attendees: null
Description: null
End: "2014-08-01T23:59:00Z"
EndTimezone: null
IsAllDay: false
JobId: 64
RecurrenceException: null
RecurrenceID: null
RecurrenceRule: null
Start: "2014-07-30T00:00:00Z"
StartTimezone: null
TaskId: 166
Timezone: null
Title: "Full engine rebuild and clean-up"
Errors: null
Total: 1

But yet the schedule does not display the event. I am obviously missing something and there are no demo's of the web scheduler using json. If someone could lead me in the right direction, that would be great.


1 Answer, 1 is accepted

Sort by
Top achievements
Rank 1
answered on 30 Jul 2014, 04:13 AM
I may have answered my own post after reading a post very similar to this.

The answer showed the correct json result. According to the demo's, the api method returns a DataSourceResult. this added extra properties to the result. I guess this requires clarification whether the additional "Errors" and "Total" properties are required by the widget.

Asked by
Top achievements
Rank 1
Answers by
Top achievements
Rank 1
Share this question