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

Recurring events causes an error when double-clicking event

2 Answers 150 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Scott
Top achievements
Rank 1
Scott asked on 22 May 2014, 05:52 PM
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}]}

2 Answers, 1 is accepted

Sort by
0
Georgi Krustev
Telerik team
answered on 23 May 2014, 11:19 AM
Hello Scott,

I prepared a demo using the provided code snippets and noticed that the SchedulerDataSource instance expects "ID" field, but the response includes only "Id" fields. I suppose that this is the cause of the problem. Here is the test demo. Could you check it and let me know if I am missing something?

Regards,
Georgi Krustev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Scott
Top achievements
Rank 1
answered on 23 May 2014, 02:10 PM
Yep, that was the problem.  Thank you so much for your help!
Tags
Scheduler
Asked by
Scott
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
Scott
Top achievements
Rank 1
Share this question
or