UPDATED: Here is the fiddle: http://jsfiddle.net/janessaallen/c3b514wf/7/
Trying to figure out why the following will not get my jsplumb connections. I have a separate flowchart save javascript file with the following function for saving:
function saveFlowchart() {
var nodes = []
$(".window").each(function (idx, elem) {
var $elem = $(elem);
var endpoints = jsPlumb.getEndpoints($elem.attr('id'));
nodes.push({
id: $elem.attr('id'),
text: $elem.find($(".beneficiary")).text(),
positionX: parseInt($elem.css("left"), 10),
positionY: parseInt($elem.css("top"), 10)
});
});
var connections = [];
$.each(jsPlumb.getConnections(), function (idx, connection) {
connections.push({
connectionId: connection.id,
sourceId: connection.sourceId,
targetId: connection.targetId,
anchors: $.map(connection.endpoints, function (endpoint) {
return [[endpoint.anchor.x,
endpoint.anchor.y,
endpoint.anchor.orientation[0],
endpoint.anchor.orientation[1],
endpoint.anchor.offsets[0],
endpoint.anchor.offsets[1]]];
})
});
});
var flowChart = {};
flowChart.nodes = nodes;
flowChart.connections = connections;
}
The endpoints work fine and get pushed to the array, but none of the connections are discovered by jsPlumb.getConnections.