我正在尝试将sourceEndpoint连接到目标div。 这是我的addEndpoint
var anEndpointSource = {
endpoint: "Dot",
cssClass:"endpoint-source",
paintStyle: {
strokeStyle: "#FF0AAC",
fillStyle: "transparent",
radius: 7,
lineWidth: 3
},
connector: connector,
connectorStyle: connectorPaintStyle,
connectorHoverStyle: connectorHoverStyle,
hoverPaintStyle: endpointHoverStyle,
connectorOverlays: overlays,
isSource: true,
isTarget: false,
maxConnections: -1,
anchor:["Bottom"]
};
jsPlumb.addEndpoint(parentnode1, { uuid: parentnode1.attr('id')+'_Bottom'}, anEndpointSource);
var id = parentnode1.attr('id');
jsPlumb.makeTarget(id, {
anchor: 'Continuous',
allowLoopback:false
});
function connectNodes(connection) {
var connection2block = jsPlumb.connect({
source:connection.sourceId,
target:connection.targetId,
anchor:"Continuous",
});
}
如果我通过将连接从源endPoint拖动到目标div来手动建立连接,则效果很好。当我尝试通过jsPLumb.connect()连接时,会出现问题。功能。
这就是我得到的(如果我通过.connect()函数进行连接,则会发生这种情况):
如您所见,连接不是从源端点发起的。
我什至尝试:
function connectNodes(connection) {
var connection2block = jsPlumb.connect({
source:connection.sourceId+'_Bottom',
target:connection.targetId,
anchor:"Continuous",
});
}
但是没有运气。请帮忙。
答案 0 :(得分:0)
我成功地将sourceEndpoint连接到目标div。解决方法如下:
function connectNodes(connection) {
var connection2block = jsPlumb.connect({
uuids: [connection.sourceId+"_Bottom"],
target:connection.targetId,
anchor:"Continuous",
});
}