When I set any of my events to include a RecurrenceRule, I suddenly can't double-click on any of the events without getting the javascript error:
Uncaught TypeError: Cannot read property 'isOccurrence' of undefined
What is causing this and how can I fix it?
I'm doing an ajax call to retrieve the data, then re-binding it to the Scheduler control. Here is my code:
// When the JSON comes back, it will capital letters like Title and Start. The scheduler needs these lower case, so define the model.
var dataSource = new kendo.data.SchedulerDataSource({
data: response.Data,
schema: {
model: {
id: "ID",
fields: {
ID: { type: "number" },
title: { field: "Title", defaultValue: "No title", validation: { required: true } },
start: { type: "date", field: "Start" },
end: { type: "date", field: "End" },
description: { field: "Description" },
recurrenceId: { from: "RecurrenceID" },
recurrenceRule: { from: "RecurrenceRule" },
recurrenceException: { from: "RecurrenceException" },
ownerId: { field: "OwnerID", defaultValue: 1 },
isAllDay: { type: "boolean", field: "IsAllDay" }
}
}
}
});
scheduler.setDataSource(dataSource);
and here is the json that is being returned:
{"Success":true,"Data":[{"Id":69314,"EventType":"Event","Title":"Event 69314","Start":"\/Date(1400772600000)\/","StartTimezone":null,"End":"\/Date(1400785200000)\/","EndTimezone":null,"Description":null,"IsAllDay":false,"Recurrence":null,"RecurrenceRule":"FREQ=DAILY","RecurrenceException":null,"EventTitle":"Air duct cleaning","AssociatedWithType":"Job","AssociatedWithId":8225,"AssociatedWithName":"25854 Maclure","JobId":"25854","Color":"#991aae","Pending":false,"Completed":false,"BackgroundColor":"#c1e4ef","FontColor":"#ff0000","ResourceDisplay":"Abigail","Resources":[{"Id":299,"Name":"Abigail","Available":false,"IsDefaultChecked":false,"Type":null,"Color":null}],"EventDuration":210,"EventDurationWorkDayPixels":47,"MinutesBeforeWorkDayStart":90,"MinutesBeforeWorkDayStartPixels":20},{"Id":69312,"EventType":"Event","Title":"Event 69312","Start":"\/Date(1400414400000)\/","StartTimezone":null,"End":"\/Date(1400454000000)\/","EndTimezone":null,"Description":null,"IsAllDay":false,"Recurrence":null,"RecurrenceRule":null,"RecurrenceException":null,"EventTitle":"Air duct cleaning","AssociatedWithType":"Job","AssociatedWithId":22345,"AssociatedWithName":"a","JobId":"a","Color":"#FFC0CB","Pending":false,"Completed":false,"BackgroundColor":"#c1e4ef","FontColor":"#ff0000","ResourceDisplay":"Chelsea","Resources":[{"Id":2,"Name":"Chelsea","Available":false,"IsDefaultChecked":false,"Type":null,"Color":null}],"EventDuration":660,"EventDurationWorkDayPixels":147,"MinutesBeforeWorkDayStart":-120,"MinutesBeforeWorkDayStartPixels":-27}]}
Uncaught TypeError: Cannot read property 'isOccurrence' of undefined
What is causing this and how can I fix it?
I'm doing an ajax call to retrieve the data, then re-binding it to the Scheduler control. Here is my code:
// When the JSON comes back, it will capital letters like Title and Start. The scheduler needs these lower case, so define the model.
var dataSource = new kendo.data.SchedulerDataSource({
data: response.Data,
schema: {
model: {
id: "ID",
fields: {
ID: { type: "number" },
title: { field: "Title", defaultValue: "No title", validation: { required: true } },
start: { type: "date", field: "Start" },
end: { type: "date", field: "End" },
description: { field: "Description" },
recurrenceId: { from: "RecurrenceID" },
recurrenceRule: { from: "RecurrenceRule" },
recurrenceException: { from: "RecurrenceException" },
ownerId: { field: "OwnerID", defaultValue: 1 },
isAllDay: { type: "boolean", field: "IsAllDay" }
}
}
}
});
scheduler.setDataSource(dataSource);
and here is the json that is being returned:
{"Success":true,"Data":[{"Id":69314,"EventType":"Event","Title":"Event 69314","Start":"\/Date(1400772600000)\/","StartTimezone":null,"End":"\/Date(1400785200000)\/","EndTimezone":null,"Description":null,"IsAllDay":false,"Recurrence":null,"RecurrenceRule":"FREQ=DAILY","RecurrenceException":null,"EventTitle":"Air duct cleaning","AssociatedWithType":"Job","AssociatedWithId":8225,"AssociatedWithName":"25854 Maclure","JobId":"25854","Color":"#991aae","Pending":false,"Completed":false,"BackgroundColor":"#c1e4ef","FontColor":"#ff0000","ResourceDisplay":"Abigail","Resources":[{"Id":299,"Name":"Abigail","Available":false,"IsDefaultChecked":false,"Type":null,"Color":null}],"EventDuration":210,"EventDurationWorkDayPixels":47,"MinutesBeforeWorkDayStart":90,"MinutesBeforeWorkDayStartPixels":20},{"Id":69312,"EventType":"Event","Title":"Event 69312","Start":"\/Date(1400414400000)\/","StartTimezone":null,"End":"\/Date(1400454000000)\/","EndTimezone":null,"Description":null,"IsAllDay":false,"Recurrence":null,"RecurrenceRule":null,"RecurrenceException":null,"EventTitle":"Air duct cleaning","AssociatedWithType":"Job","AssociatedWithId":22345,"AssociatedWithName":"a","JobId":"a","Color":"#FFC0CB","Pending":false,"Completed":false,"BackgroundColor":"#c1e4ef","FontColor":"#ff0000","ResourceDisplay":"Chelsea","Resources":[{"Id":2,"Name":"Chelsea","Available":false,"IsDefaultChecked":false,"Type":null,"Color":null}],"EventDuration":660,"EventDurationWorkDayPixels":147,"MinutesBeforeWorkDayStart":-120,"MinutesBeforeWorkDayStartPixels":-27}]}