Quantcast
Channel: GoJS - Northwoods Software
Viewing all articles
Browse latest Browse all 7069

Programmatically adding a new node after another node is dragged

$
0
0

@jc78 wrote:

I have a diagram listener, "ExternalObjectsDropped", that is called when I drag a node into my diagram from a Palette next to it..

In response to that newly dragged node, I'd like to create other new nodes using the model.addNodeDataCollection and model.addLinkDataCollection. But I'm performing this logic with my ExternalObjectsDropped event handler, and I feel that this is the wrong place. Also I'm getting an error that I shouldn't modify my model's data while a "transaction" is in progress.

What is the proper way to programmatically add nodes based on other nodes being dragged into my diagram? Would I have to do some kind of callback called from the event handler?

Posts: 3

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 7069

Trending Articles