我是JsPlumb的新手,遇到一个问题: 在我拖动元素之前,添加到元素的连接不会显示。有关详细信息,请参见视频:https://drive.google.com/file/d/1hgswkCjVh_fSQibLCsVwfkPiMsQeEJ_h/view?usp=sharing 而且,即使我将它们配置为连续的,连接也总是从左上角开始。
我通过Java代码构建javascript,所以这是我要执行的操作:
"<script>" + "jsPlumb.setContainer(document.getElementById(\"diagramContainer\"));\n" + "jsPlumb.Defaults.Anchor = \"Continuous\";\n" + "jsPlumb.Defaults.Connector = \"Bezier\";\n" + "jsPlumb.Defaults.Endpoint = \"Blank\";\n" + "jsPlumb.Defaults.Overlays = [ [\"Arrow\" , { width:12, length:12, location:0.67 }] ];" + "jsPlumb.ready(function() {" + connectionJavascript[0] + "});" + "</script>";
使用connectionJavaScript(针对我所需的每个连接):
"jsPlumb.connect({" + "source:\"" + (lastEvent[0] != null ? lastEvent[0] : "START-EVENT") + "\"," + "target:\"" + map.get("eventname") + "\"" + "});";