将现有的 addEndpoint() 连接到 jsPlumb 中的现有 makeTarget()
Connecting existing addEndpoint() to existing makeTarget() in jsPlumb
我在其他地方看到了以下用于附加现有端点的技术。当使用 addEndpoint()
创建源和目标时,这工作正常
var e0 = jsPlumb.addEndpoint("container0",{uuid:"ep1"}), //set your own uuid for endpoint for later access.
var e1 = jsPlumb.addEndpoint("container1",{uuid:"ep2"});
jsPlumb.connect({ uuids:[e1.getUuid(),e2.getUudi()] }); // (or) jsPlumb.connect({ uuids:["ep1","ep2"] });
但是,在我的情况下,我需要加入并端点到使用 makeTarget()
创建的目标
var e0 = jsPlumb.addEndpoint("container0",{uuid:"ep1"}), //set your own uuid for endpoint for later access.
var e1 = jsPlumb.makeTarget("container1",{uuid:"ep2"});
jsPlumb.connect({ uuids:[e1.getUuid(),e2.getUudi()] }); // (or) jsPlumb.connect({ uuids:["ep1","ep2"] });
但是这不起作用,makeTarget()
的返回结果甚至没有 getUuid()
方法。
我怎样才能做到这一点?
这应该有效:
jsPlumb.connect({
source: sourceUUID,
target: targetID,
uuids: [sourceUUID, targetID],
editable: true
});
我在其他地方看到了以下用于附加现有端点的技术。当使用 addEndpoint()
var e0 = jsPlumb.addEndpoint("container0",{uuid:"ep1"}), //set your own uuid for endpoint for later access.
var e1 = jsPlumb.addEndpoint("container1",{uuid:"ep2"});
jsPlumb.connect({ uuids:[e1.getUuid(),e2.getUudi()] }); // (or) jsPlumb.connect({ uuids:["ep1","ep2"] });
但是,在我的情况下,我需要加入并端点到使用 makeTarget()
var e0 = jsPlumb.addEndpoint("container0",{uuid:"ep1"}), //set your own uuid for endpoint for later access.
var e1 = jsPlumb.makeTarget("container1",{uuid:"ep2"});
jsPlumb.connect({ uuids:[e1.getUuid(),e2.getUudi()] }); // (or) jsPlumb.connect({ uuids:["ep1","ep2"] });
但是这不起作用,makeTarget()
的返回结果甚至没有 getUuid()
方法。
我怎样才能做到这一点?
这应该有效:
jsPlumb.connect({
source: sourceUUID,
target: targetID,
uuids: [sourceUUID, targetID],
editable: true
});