Add custom connectors

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

    Posted 28 Apr 2015 Link to this post

    Hi

    I am trying to add a custom connector to a rectangle in MVC, but am struggling top work out how to do it. This is the code I am using;

           .ShapeDefaults(sd => sd.Connectors(o =>
          {
            o.Add().Name("top");
            o.Add().Name("right");
            o.Add().Name("bottom");
            o.Add().Name("left");
            o.Add().Name("auto");
            o.Add().Name("bottomRight");
            o.Add().Name("topRight");
            o.Add().Name("bottomLeft");
            o.Add().Name("topLeft");
            o.Add().Name("topRightMiddle").Position("function(shape) { var p = shape.bounds().top(); return shape._transformPoint(new kendo.dataviz.diagram.Point(p.x + 15, p.y)); }");
          })

    When I run this, none of the connectors are added. When I run it without the 'topRightMiddle' connector, it works fine and all the named connectors are added. How should the 'Position' method parameter be constructed?

    Thanks

    Jared

  2. Daniel
    Admin
    Daniel avatar
    2118 posts

    Posted 30 Apr 2015 Link to this post

    Hello Jared,

    This seems like a bug. The Position value should be serialized as function but it is serialized as string. We will fix this for the next internal build and I updated your Telerik points for the bug report.

    Regards,
    Daniel
    Telerik
     

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

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