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.
If directly tried setting the dataSource as the widget is instantiated or later as per the following
Both methods trigger the SchedulerDataSource to fetch the data
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.
Thanks
But do you think i can get the json data type to work. Here is my code thus far.
var dsSchedule = new kendo.data.SchedulerDataSource({
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" }
},
},
},
});
$("#scheduler").kendoScheduler({
date: new Date(),
startTime: new Date(),
height: 600,
views: ["day", { type: "workWeek", selected: true }, "week", "month", "agenda"],
dataSource: dsSchedule
});
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" }
},
},
},
});
$("#scheduler").kendoScheduler({
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");
scheduler.setDataSource(dsSchedule);
Both methods trigger the SchedulerDataSource to fetch the data
AggregateResults: null
Data: [,…]
0:
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.
Thanks