How can I not allow nodes and groups to drag


Hey guys!
I think I want to prevent the node from dragging when the node is dragged into the group. When a group is dragged into another group, the group is not dragged. How do I achieve this?


Do you mean you don’t want to allow a drop in those cases, or are do you want to actually prevent a node from being dragged there?

Maybe the Swim Lanes sample has some of the behavior you’re looking for?


I want to achieve the node can not drag the group, you can give the example can also drag the group inside the node


Sorry, it’s still not clear to me what you want. Could you describe the behavior you want in the context of the Regrouping sample?

What should happen if the user tries to drag “first A” into another group?
What should happen if the user tries to drag “first A” onto the diagram background?
What about dragging “Group B” into “Group A” or “Main 2”?


Cannot drag the Group A and Group B groups in the Main1 group
Can’t drag first A and first B in Group A
Cannot drag Main1 group and Main2 group
Only drag nodes or groups from palette into Diagram


You could set DraggingTool.isEnabled to false on your main diagram.

myDiagram =
  $(go.Diagram, "myDiagramDiv",
      allowDrop: true, // from Palette
      "draggingTool.isEnabled": false,