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

Add custom connectors

1 Answer 98 Views
Diagram
This is a migrated thread and some comments may be shown as answers.
Jared
Top achievements
Rank 1
Jared asked on 28 Apr 2015, 02:00 PM

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

1 Answer, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 30 Apr 2015, 11:55 AM
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.

 
Tags
Diagram
Asked by
Jared
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Share this question
or