Search
Events.nodeCreated Property
See Also
 





Raised when the user draws a new node.

Namespace: MindFusion.Diagramming
Package: Events.js

 Syntax

JavaScript  Copy Code

get nodeCreated() {}
set nodeCreated(value) {}

 Property Value

String

A string containing the event name.

 Remarks

Event handlers receive a NodeEventArgs instance as argument.

 Example

This example handles the nodeCreated event to set new node's anchorPattern.

JavaScript  Copy Code

diagram.addEventListener(Events.nodeCreated, (sender, args) => {
    if (sender.defaultShape.id == "Rectangle")
        args.node.anchorPattern = pattern1;
    else
        args.node.anchorPattern = pattern2;
});

 See Also