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

Diagram Create Shape not working in Editing controller

2 Answers 157 Views
Diagram
This is a migrated thread and some comments may be shown as answers.
Ron
Top achievements
Rank 2
Ron asked on 30 Jun 2015, 08:04 PM

Hello All,

         I am just trying to see the code in the Kendo examples for diagram implementation that I have downloaded recently (Latest release telerik.ui.for.aspnetmvc.2015.2.624.commercial), But when I run the solution locally and browse the 'Editing' section of the diagram I do get the shapes and connections as in demo site but I am not able to add a new shape (or new rectangle) to the diagram. When I press the rectangle icon in tool bar I get a error in browser console as follows.

Chrome: kendo.all.min.js:68 Uncaught TypeError: Cannot read property 'gradient' of undefined)

FireFox: kendo.all.min.js:68:8298 TypeError: t is undefined

 Also other options in the tool bar are also not working.

 

2 Answers, 1 is accepted

Sort by
0
Accepted
Daniel
Telerik team
answered on 02 Jul 2015, 11:43 AM
Hello Ron,

This is a known issue when setting null or undefined for the elements fill(fill: dataItem.Color, for new items) option. The problem is already fixed and the fix will be included in the next internal build. A workaround for now is to set a default value for the color when creating the visual:
g.append(new dataviz.diagram.Rectangle({
    width: 8,
    height: 67,
    fill: dataItem.Color || "#586477",
    stroke: {
        width: 0
    }
}));
or for the Color field in the model:
m.Field(s => s.Color).DefaultValue("#586477");


Regards,
Daniel
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Ron
Top achievements
Rank 2
answered on 03 Jul 2015, 10:24 AM
Thanks Daniel, That did resolve the issue.
Tags
Diagram
Asked by
Ron
Top achievements
Rank 2
Answers by
Daniel
Telerik team
Ron
Top achievements
Rank 2
Share this question
or