Diagram connected shapes

3 posts, 0 answers
  1. Aaron
    Aaron avatar
    15 posts
    Member since:
    Feb 2013

    Posted 15 Apr 2014 Link to this post

    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. Hristo Germanov
    Admin
    Hristo Germanov avatar
    703 posts

    Posted 17 Apr 2014 Link to this post

    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!
     
  3. Kendo UI is VS 2017 Ready
  4. Aaron
    Aaron avatar
    15 posts
    Member since:
    Feb 2013

    Posted 23 Apr 2014 in reply to Hristo Germanov Link to this post

    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.    });
Back to Top