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

Replace existing node with external node

$
0
0

@llam wrote:

Hi,

In GoJS, we’d like to be able to replace existing nodes in a diagram with external nodes. We have a set of node “templates” which we drag onto to the main canvas, and we listen for the ExternalObjectsDropped events to place those nodes on the canvas. We’re able to drag new new nodes just fine, but we’d like to be able to replace existing nodes using a drag and drop event similar to mouseDrop.

The reason we’re not using mouseDrop for this is because we’d like to limit this behavior to dropping new node “templates” on the diagram. We don’t want to exhibit the node replacement behavior when moving existing nodes in the diagram.

Looking at the ExternalObjectsDropped event, I didn’t see any way to get the target node like there is for mouseDrop. Seems like just the source diagram and parts are available. Is there a way to get target information from ExternalObjectsDropped? Would using the mouseDrop event be preferred? If so, Is there a way to determine if the object being dropped in the mouseDrop event an external object?

https://gojs.net/latest/api/symbols/DiagramEvent.html

Thanks for any help!

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 7069

Trending Articles