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

How can I copy a subtree with a link to the original parent?

$
0
0

@warren.reed wrote:

Hi

I'm using a GoJS diagram together with an instance of go.GraphLinksModel. I'm trying to copy and paste a subtree and preserve the link to the original parent. I've set commandHandler.copiesTree = true and this allows me to successfully copy my selected node as well as its children. However, the copied subtree is not linked to the original parent.

In my screenshot, I selected the "Experience 1" node and copy/pasted it. A copy of the subtree was created (Experience 1 (Copy)) but I need it to be linked to the original parent (Journey Satisfaction).

How can I implement this behaviour?

I think i need to override the command handler's copyToClipboard function (https://gojs.net/latest/api/symbols/CommandHandler.html#copyToClipboard) but I'm not sure how to proceed.

Thanks so much.

Posts: 4

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 7069

Trending Articles