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

Copy (ctrl+c) and paste (ctrl+v) a node behaviour

$
0
0

@Jednorozec wrote:

Hello,

I’m trying to copy/paste a node with some properties as shown below:

image

I would really like to copy/paste the whole node just as it’s implemented by default, but with one change. The newly created node (with ctrl+c/ctrl+v), should only be changed in the start property as shown above.

I tried to achieve this, by adding a diagram listener as shown below:

    this.diagram.addDiagramListener('ClipboardPasted', (e) => {
      e.subject.each((p) => {
        console.log(p.part.data);
        p.part.data.typeAttributes.status.start = false;
      })
    });

But this seems to change the start property of both, copied and pasted node, even though the console.log is loging only the pasted node (and not the copied one).

I also tried the ChangedSelection event, but with the same effect, both changes.

I would be grateful for any advice.

Best regards.

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 7069

Trending Articles