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

Adding new task "Cannot read property 'set' of undefined"

1 Answer 1331 Views
Gantt
This is a migrated thread and some comments may be shown as answers.
Web
Top achievements
Rank 1
Web asked on 05 Jun 2017, 09:37 AM

Hi,

Can't figure out why the code on the following link is returning this JS error when trying to add a new un-nested task: "Uncaught TypeError: Cannot read property 'set' of undefined"

I've narrowed it down to the following code - it doesn't seem to be related to the (temporarily blank) create/update/delete parts of the datasource since exactly the same happens even when they return the correct responses, even running the same as the official demos with the exception of changing the datasource to JSON.

 

 

 

 

https://mtpubdev1.microtest.co.uk/kendo/

 

Any help would be most appreciated.

kendo.all.min.js:80 Uncaught TypeError: Cannot read property 'set' of undefined at init._reorderSiblings (kendo.all.min.js:80) at init.insert (kendo.all.min.js:80) at init.add (kendo.all.min.js:80) at init._createTask (kendo.all.min.js:80) at init.r (kendo.all.min.js:80) at init.trigger (kendo.all.min.js:25) at HTMLButtonElement.<anonymous> (kendo.all.min.js:79) at HTMLDivElement.dispatch (jquery-1.12.4.min.js:3) at HTMLDivElement.r.handle (jquery-1.12.4.min.js:3)
kendo.all.min.js:80 Uncaught TypeError: Cannot read property 'set' of undefined at init._reorderSiblings (kendo.all.min.js:80) at init.insert (kendo.all.min.js:80) at init.add (kendo.all.min.js:80) at init._createTask (kendo.all.min.js:80) at init.r (kendo.all.min.js:80) at init.trigger (kendo.all.min.js:25) at HTMLButtonElement.<anonymous> (kendo.all.min.js:79) at HTMLDivElement.dispatch (jquery-1.12.4.min.js:3) at HTMLDivElement.r.handle (jquery-1.12.4.min.js:3)
kendo.all.min.js:80 Uncaught TypeError: Cannot read property 'set' of undefined at init._reorderSiblings (kendo.all.min.js:80) at init.insert (kendo.all.min.js:80) at init.add (kendo.all.min.js:80) at init._createTask (kendo.all.min.js:80) at init.r (kendo.all.min.js:80) at init.trigger (kendo.all.min.js:25) at HTMLButtonElement.<anonymous> (kendo.all.min.js:79) at HTMLDivElement.dispatch (jquery-1.12.4.min.js:3) at HTMLDivElement.r.handle (jquery-1.12.4.min.js:3)
kendo.all.min.js:80 Uncaught TypeError: Cannot read property 'set' of undefined at init._reorderSiblings (kendo.all.min.js:80) at init.insert (kendo.all.min.js:80) at init.add (kendo.all.min.js:80) at init._createTask (kendo.all.min.js:80) at init.r (kendo.all.min.js:80) at init.trigger (kendo.all.min.js:25) at HTMLButtonElement.<anonymous> (kendo.all.min.js:79) at HTMLDivElement.dispatch (jquery-1.12.4.min.js:3) at HTMLDivElement.r.handle (jquery-1.12.4.min.js:3)
kendo.all.min.js:80 Uncaught TypeError: Cannot read property 'set' of undefined at init._reorderSiblings (kendo.all.min.js:80) at init.insert (kendo.all.min.js:80) at init.add (kendo.all.min.js:80) at init._createTask (kendo.all.min.js:80) at init.r (kendo.all.min.js:80) at init.trigger (kendo.all.min.js:25) at HTMLButtonElement.<anonymous> (kendo.all.min.js:79) at HTMLDivElement.dispatch (jquery-1.12.4.min.js:3) at HTMLDivElement.r.handle (jquery-1.12.4.min.js:3)
kendo.all.min.js:80 Uncaught TypeError: Cannot read property 'set' of undefined at init._reorderSiblings (kendo.all.min.js:80) at init.insert (kendo.all.min.js:80) at init.add (kendo.all.min.js:80) at init._createTask (kendo.all.min.js:80) at init.r (kendo.all.min.js:80) at init.trigger (kendo.all.min.js:25) at HTMLButtonElement.<anonymous> (kendo.all.min.js:79) at HTMLDivElement.dispatch (jquery-1.12.4.min.js:3) at HTMLDivElement.r.handle (jquery-1.12.4.min.js:3)
kendo.all.min.js:80 Uncaught TypeError: Cannot read property 'set' of undefined at init._reorderSiblings (kendo.all.min.js:80) at init.insert (kendo.all.min.js:80) at init.add (kendo.all.min.js:80) at init._createTask (kendo.all.min.js:80) at init.r (kendo.all.min.js:80) at init.trigger (kendo.all.min.js:25) at HTMLButtonElement.<anonymous> (kendo.all.min.js:79) at HTMLDivElement.dispatch (jquery-1.12.4.min.js:3) at HTMLDivElement.r.handle (jquery-1.12.4.min.js:3)
kendo.all.min.js:80 Uncaught TypeError: Cannot read property 'set' of undefined at init._reorderSiblings (kendo.all.min.js:80) at init.insert (kendo.all.min.js:80) at init.add (kendo.all.min.js:80) at init._createTask (kendo.all.min.js:80) at init.r (kendo.all.min.js:80) at init.trigger (kendo.all.min.js:25) at HTMLButtonElement.<anonymous> (kendo.all.min.js:79) at HTMLDivElement.dispatch (jquery-1.12.4.min.js:3) at HTMLDivElement.r.handle (jquery-1.12.4.min.js:3)
kendo.all.min.js:80 Uncaught TypeError: Cannot read property 'set' of undefined at init._reorderSiblings (kendo.all.min.js:80) at init.insert (kendo.all.min.js:80) at init.add (kendo.all.min.js:80) at init._createTask (kendo.all.min.js:80) at init.r (kendo.all.min.js:80) at init.trigger (kendo.all.min.js:25) at HTMLButtonElement.<anonymous> (kendo.all.min.js:79) at HTMLDivElement.dispatch (jquery-1.12.4.min.js:3) at HTMLDivElement.r.handle (jquery-1.12.4.min.js:3)

Any

1 Answer, 1 is accepted

Sort by
0
Accepted
Nencho
Telerik team
answered on 07 Jun 2017, 10:11 AM
Hello,

The reason for the experienced issue is the defined schema. The DefaultValue of the parentId field declaration is missing. Consider the following implementation of the schema:

schema: {
                model: {
                    id: "id",
                    fields: {
                        id: { from: "id", type: "string" },
                        orderId: { from: "order_id", type: "number", validation: { required: true } },
                        parentId: { from: "parent", type: "string", defaultValue: null, validation: { required: true } },
                        start: { from: "date_started", type: "date" },
                        end: { from: "date_due", type: "date" },
                        title: { from: "name", defaultValue: "", type: "string" },
                        percentComplete: { from: "percent", type: "number", defaultValue: 0 },
                        summary: { from: "summary", type: "boolean" }, expanded: { from: "expanded", type: "boolean", defaultValue: true }
                    }
                }
            }

Hope this would help.

Regards,
Nencho
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
Gantt
Asked by
Web
Top achievements
Rank 1
Answers by
Nencho
Telerik team
Share this question
or