Deny to disconnect connector for specific node

Hi Syncfusion.

Is it possible to deny disconnection connector by target or source id for specific nodes?
I tried args.cancel=true for collection change event, but that didn't work.

Can you provide some sample?

Thanks

1 Reply 1 reply marked as answer

AM Arunkumar Manoharan Syncfusion Team June 16, 2021 02:08 PM UTC

Hai Alex, 
 
We have added a sample to demonstrate how to deny disconnection of connector for specific node. In this sample we used connectionChange event for denying disconnection. By checking the specific nodeId in changing state and preventing the connector disconnection. For more information, please refer to the below code snippet and sample.  
Code snippet: 
connectionChange: (args) => { 
        let diagram = this.$refs.diagramObject.ej2Instances; 
        if (args.state === "Changing") { 
          let checkNode = diagram.getObject(args.oldValue.nodeId); 
          if (checkNode && checkNode.id === "node4") { 
            args.cancel = true; 
          } 
        } 
      }, 
 

Regards,
Arun.
 
  


Marked as answer
Loader.
Up arrow icon