Skip to content Skip to sidebar Skip to footer

Jsplumb Removes Straight Connection When Calling Setpaintstyle()

I am using jsPlumb for a medium size project. Although the documentation is slim in terms of solid explanations, I've managed to complete the project and now I'm ready to deliver i

Solution 1:

For others out there that might come across this frustrating jsPlumb bug. After spending my whole Saturday looking for a fix, finally I found a way around this.

Instead of using the setPaintStyle() method to change the stroke-color, I actually used a combination of the getPaintStyle() and repaint() methods. Here is a fixed jsBin example: http://jsbin.com/ogekot/7/edit

jsPlumb.bind('click', function (connection, e) {
   e.preventDefault();

   connection.getPaintStyle().strokeStyle = '#CE322A';
   connection.repaint()
});

Post a Comment for "Jsplumb Removes Straight Connection When Calling Setpaintstyle()"