基于JGraph,怎么实现节点的禁止拖动

我获取到了面板组件上的节点对象,进行判断后用setDraEnable方法无反应,应该用什么方法来实现呢

可以尝试使用JGraph的mxgraph.edit.disableEdit方法来禁止节点的拖动,例如:

var graph = new mxGraph();
graph.edit.disableEdit(true);

或者可以通过调用mxGraph的setCellsLocked方法来设置指定单元格禁止被拖动。 例如:

var cell = graph.getSelectionCells()[0];
 graph.setCellsLocked(true, cell)