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

Diagram connected shapes

2 Answers 202 Views
Diagram
This is a migrated thread and some comments may be shown as answers.
Aaron
Top achievements
Rank 1
Aaron asked on 15 Apr 2014, 11:15 PM
How do I grab all shapes that are connected?  I see methods to check if two shapes are connected...but nothing to show which objects are connected...Perhaps as an array of JSON  like this?

[
  {shape1: { name: "something1", path: "/index" }, connector: { name: "connectortype1" }, shape2: { name: "something2", path: "/index2" } },
  {shape1: { name: "something3", path: "/index" }, connector: { name: "connectortype1" }, shape2: { name: "something4", path: "/index2" } }
]

2 Answers, 1 is accepted

Sort by
0
Hristo Germanov
Telerik team
answered on 17 Apr 2014, 03:40 PM
Hello Aeron,

You can get all connections with $("yourDivSelector").getKendoDiagram().connections. Then you can get the connected shapes from connections[0].from and connections[0].to.

Regards,
Hristo Germanov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Aaron
Top achievements
Rank 1
answered on 23 Apr 2014, 07:49 PM
Sorry for the late response...but just wanted to let you know that the solution worked...with a bit more code:
1.$("#dragDropFiles").on('dblclick', function(event) {
2.        var connections = $("#dragDropFiles").getKendoDiagram().connections;
3.         
4.        $.each(connections, function(index,value) {
5.            console.log(value.from.shape.model.text + ' to ' + value.to.shape.model.text);
6.        });
7.    });
Tags
Diagram
Asked by
Aaron
Top achievements
Rank 1
Answers by
Hristo Germanov
Telerik team
Aaron
Top achievements
Rank 1
Share this question
or