jsPlumb.Defaults.Endpoints = [ ["Blank"], ["Image", {src: "/images/
arrow.png", id:"image"}] ];
(note the 'image' parameter).
then inside your loops:
dest[i].endpoints[0].getOverlay("image").setImage( the other url )
or
src[i].endpoints[0].getOverlay("image").setImage( the other url )
the 'endpoints' array has two elements. index 0 is the source, index 1
is the target.
btw you might want to look at the new 'select' method in 1.3.7. it
helps you when you want to loop through a list of connections.
jsPlumb.select({source:vertexid }).each(function(c) {
c.endpoints[1].getOverlay("image").setImage(hoverendpointPath);
});
--
Simon Porritt
oh well. without being able to look over any code or having any insight into exactly how it doesn't work (are there console errors, for example?), i can't really help you any further unless you post me a link to a jsFiddle.
Assigning an id to the endpoint was not correct - the whole getOverlay
thing was wrong. The actual code you needed was:
.each(function(connection) {
connection.endpoints[1].setImage("http://www.ggrightsize.com/images/misc/icon-triangle2.png");
});
..but after I realised that and tested it, i discovered there's
actually a bug in that method in jsPlumb! I've fixed it in 1.3.8,
which I am going to release soon.
This is the code you'll need, but of course I can't link it to a 1.3.8
version because it's not finalised yet:
http://jsfiddle.net/sporritt/Wmccf/11/
(note that you can save yourself some typing if you chain the .each
call to the previous setPaintStyle call). also you might want to look
at the importDefaults method in the documentation.
Simon
hey and was it you who was asking about making the highlighted
connected appear on top of the others? i'm going to do that for
1.3.9.