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

AngularJS Databind odata to kendoui diagram

1 Answer 124 Views
Diagram
This is a migrated thread and some comments may be shown as answers.
Wit
Top achievements
Rank 1
Wit asked on 06 Aug 2014, 01:02 PM
I am trying to databind ASP.NET web api odata v3 to kendoui diagram
control. It works OK with local data source but I am getting error when
trying to use odata

Error:

Uncaught TypeError: Cannot read property '__count' of undefined

HTML

<div kendo-diagram="diagram" k-options="options" />


AngularJS
$scope.options = {
dataSource: {
type: "odata",
transport: {
read: {
url: "odata/Entities",
dataType: "json",
type: "GET"
}
}
},
shapeDefaults: {
visual: visualTemplate
},
layout: {
type: "tree"
},
schema: {
data: "value"
}
};



function visualTemplate(options) {
var dataviz = kendo.dataviz;
var g = new dataviz.diagram.Group();
var dataItem = options.dataItem;

g.append(new dataviz.diagram.Rectangle({
width: 210,
height: 75,
stroke: {
width: 0
},
fill: "green"
}));

g.append(new dataviz.diagram.TextBlock({
text: dataItem.Name,
x: 85,
y: 20,
color: "#fff"
}));

return g;
}

json

{
"odata.metadata":"http://localhost/TestSPA/odata/$metadata#Entities","odata.count":"5","value":[
{
"EntityRef":7,"Name":"Test"
}
]
}

1 Answer, 1 is accepted

Sort by
0
T. Tsonev
Telerik team
answered on 07 Aug 2014, 08:33 AM
Hello,

I'm copying the response from your ticket for community reference:

Currently, the Kendo UI DataSource supports only OData v2. Using a v3 source is possible for reading data, using the workaround described in this answer on SO.
We're currently gathering feedback regarding OData v3 and v4 support. Please, feel free to share your opinion and vote for this feature.

Regards,
T. Tsonev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Diagram
Asked by
Wit
Top achievements
Rank 1
Answers by
T. Tsonev
Telerik team
Share this question
or