Connection layout problems

6 posts, 0 answers
  1. Jared
    Jared avatar
    4 posts
    Member since:
    Oct 2012

    Posted 27 Apr 2015 Link to this post

    Hi

    I am trialling your product with a view to purchasing soon, but am having some issues with the default rendering of connections. I am using Layout Type and Down SubType. I've attached two files. One is the vertical layout that I am trying to achieve, but as you can see the connections don't look great. The second is a horizontal layout which seems to render much better, but isn't what I want.

    Is there anything I can do to correct this. I tried adding new connectors to the shape, but can't work out what should go in the Position property in MVC.

    Thanks

    Jared

  2. Daniel
    Admin
    Daniel avatar
    2117 posts

    Posted 29 Apr 2015 Link to this post

    Hello Jared,

    Which version are you using? We made some improvements in the connections routing in the 2015 Q1 serive pack release(2015.1.408) which should prevent the connections overlapping the shapes at least in most cases. If you using 2015.1.408 or later then could you provide the code for the diagram and a sample of the data so I can test the case?

    Regards,
    Daniel
    Telerik
     

    See What's Next in App Development. Register for TelerikNEXT.

     
  3. UI for ASP.NET MVC is VS 2017 Ready
  4. Jared
    Jared avatar
    4 posts
    Member since:
    Oct 2012

    Posted 29 Apr 2015 in reply to Daniel Link to this post

    Hi

    We are using version 2015.1.408.545 of the Kendo.Mvc assembly and 2015.1.408 of the kendo.dataviz.diagram.min.js files.

    I have attached the relevant code files as a zip. I can't send you the whole solution, so hopefully you can get what you need from there?

    Thanks

    Jared

     

     

     

     

  5. Daniel
    Admin
    Daniel avatar
    2117 posts

    Posted 04 May 2015 Link to this post

    Hello again Jared,

    Thanks for the files. I reproduced the problems from the image. The problem with the connection from "Test Company 2" to "Test Trust 5" occurs because the of the order in which the shapes are layouted. You can avoid it by refreshing the connections after the diagram is bound:
    function onDataBound(e) {
        var diagram = this;
        setTimeout(function () {
            for (var i = 0; i < diagram.connections.length; i++) {
                diagram.connections[i].refresh();
            }
        }, 0);
    }
    We will look into to the case with the other overlapping connection.

    Regards,
    Daniel
    Telerik
     

    See What's Next in App Development. Register for TelerikNEXT.

     
  6. Jared
    Jared avatar
    4 posts
    Member since:
    Oct 2012

    Posted 05 May 2015 in reply to Daniel Link to this post

    Thanks. Would you be able to put that in the context of my View code. I'm not sure how to hook that method up, the api documentation you referenced is a bit sparse.
  7. Daniel
    Admin
    Daniel avatar
    2117 posts

    Posted 07 May 2015 Link to this post

    Hi,

    The event handler can be specified with the wrapper Events DataBound method:
    Html.Kendo().Diagram<StructureChartEntityModel, StructureChartLinkModel>()
          .Name("diagram")
          .Events(events => events.DataBound("onDataBound"))


    Regards,
    Daniel
    Telerik
     

    See What's Next in App Development. Register for TelerikNEXT.

     
Back to Top
UI for ASP.NET MVC is VS 2017 Ready