I am using JSplumb for connections, I am getting some data from JSON and based on that I want to make connection between two endpoints, I have already created structure and created endpoints on each node, I tried to find this on jsplumb documentation but couldn't..
Asked
Active
Viewed 777 times
0
-
1I guess I don't know what JSON data you are receiving and how you plan on using it to connect your endpoints; but if the endpoints are already in place - don't you just use jsPlumb.connect() and pass it the source and target elements that have the endpoints you added? – Mark Jan 25 '13 at 18:41
-
Are you asking how to connect two endpoints in jsPlumb? Of course there is extensive explanation on how to do that in the documentation. Where is your code so far and what is the error you are getting? If you post a jsFiddle it would be much easier to find the issue. – Aras Jan 28 '13 at 01:12
1 Answers
0
At the time of adding endpoints make sure that you also assign them Uuid based on the element it is placed on. You can connect two endpoints in jsPlumb as:
jsPlumb.ready(function () {
var e0 = jsPlumb.addEndpoint("container0",{uuid:"ep0"}), //set your own uuid for endpoint for later access.
e1 = jsPlumb.addEndpoint("container1",{uuid:"ep1"});
jsPlumb.connect({ uuids:[e0.getUuid(),e1.getUudi()] });
// (or)
jsPlumb.connect({ uuids:["ep0","ep1"] });
});

MrNobody007
- 1,827
- 11
- 32