Modify Dragged Node Property


While dragging the Node and placing it in the same diagram, want to modify some of the properties.

For example i have a node named “Service”. I dragged the item (Using ctrl + mouse left) and placed it in the same diagram. I want to modify some of the properties of newly created Node.

Can you please tell me how to achieve this?

I tries copyNodeDataFunction…But it is giving the property of the original node not the copied node.

The easiest way to modify copied data objects is to implement a “SelectionCopied” DiagramEvent listener that makes whatever changes you want to the data, preferably by calling Model.set.

Consider also other similar DiagramEvents such as “ClipboardPasted” and “ExternalObjectsDropped”.

Model.copyNodeDataFunction is for customizing how a copied data object is constructed. The default behavior is to create a new plain JavaScript object and copy almost all of the enumerable properties – a shallow copy. Depending on your requirements, you could implement it this way too, but at that time you don’t have much context for the copying.