I am trying to create flow-charts using jsPlumb. I am using it on xhtml file and considering to use it with a backing bean later on. I was messing with preview of drag and drop demo on their website and mutated it a little according to my need. It basically removes End Points(EP) from a chart and makes them non-draggable. My code is working on html file, however, whenever I use it with xhtml charts disappear on setting their draggable on false. It doesn't do that if I use true. Anyway, my question is why it's behaving in such way and how can I solve it?
Here's some parts of my code:
function preview() {
var windows = $(".shape");
var x;
for ( var i = 0; i < windows.length; i++) {
x = windows[i].getElementsByClassName("ep");
windows[i].removeChild(x[0]);
jsPlumb.setDraggable(windows[i], false); // makes charts disappear
}
jsPlumb.repaintEverything();
}
Again, exact code works on html file. xhtml file can be found here and javascript file can be found here