I have Created and Palette and am dropping objects from that palette into the main diagram.
Currenrtly my node is being added in open(without any links) but I want it to be added as a child of my root node.
I tried using diagram class’ mouseDrop Event but could not find the item being droped. If I could do that I will use the item’s data to add a node with basic model Diagram.model.addNodeData and Diagram.model.addLinkData.
Now when I drop in blank space, a link is created from the triangular node to the new node.
However, I still got one issue. When I drop on any other node, the above said link is still getting created but, I want that only when i drop new item in blank space and not when I drop on nodes(becausein that case we need it to be added as a child to those nodes).
The issue was that both node’s mouseDrop and diagram’s ExternalDrop events were firing in case I dropped on the node.
I solved it by setting key of my node in node’s mouseDrop and checking if its been set or not in diagram’s ExternalDrop. If its been set earlier in node’s mouseDrop … RETURN