2

I'm having a hell of a time with jsPlumb trying to create two connections from the same source anchor.

For example, in the JSFiddle below I'm trying to create two connections from the block 1 anchor to the two other blocks 2 and 3. http://jsfiddle.net/dutchman71/TYerW/3/

For some reason it works fine in the jsPlumb example here with the green dot anchors. http://jsplumb.org/jquery/draggableConnectorsDemo.html#

Can anyone tell my what I'm missing?

            var endpointOptions = { 
                    anchor:"BottomCenter",
                    maxConnections:-1, 
                    isSource:true, 
                    isTarget:true, 
                    endpoint:["Dot", {radius:6}], 
                    setDragAllowedWhenFull:true,
                    paintStyle:{fillStyle:"#5b9ada"},
                    connectorStyle : {  lineWidth: 4, strokeStyle:"#5b9ada" },
                    connector:[ "Bezier", { curviness:1 }],
                    connectorOverlays:[ 
                        [ "Arrow", { width:15, length:15, location:1, id:"arrow" } ], 
                        [ "Label", { label:"", id:"label" } ]
                    ]               
                    }

            jsPlumb.bind("ready", function() {

                    jsPlumb.addEndpoint('block1', endpointOptions);

                    jsPlumb.addEndpoint('block2', endpointOptions);

                    jsPlumb.addEndpoint('block3', endpointOptions);

                    jsPlumb.draggable('block1');
                    jsPlumb.draggable('block2');
                    jsPlumb.draggable('block3');
            });

3 Answers 3

1

A nice guy on Google groups helped me out on this one: the jsPlumb version I included from another sample is obsolete. If I include this one http://jsplumb.org/js/jquery.jsPlumb-1.3.16-all-min.js is works fine.

1
  • Thank you for giving the answer on this one, had me stuck too. Apr 5, 2015 at 19:11
0

set maxconnections to a positive integer. that should do it.

and maybe you should make your endpoints bigger and give the connector lines a smallr z-index, than the enpoints, so you won't missclick on the canvas instead of the div (the canvas blocks almost the whole div on Block 1 after a connection is established to Block 2 check it in your element inspector/firebug/etc)

0

Change the radius of the endPoint to endpoint

["Dot", {radius:1}],

and connectorStyle's line width to 1

connectorStyle : { lineWidth: 4, strokeStyle:"#5b9ada" }

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.