We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Is it possible to lock individual nodes/connectors (instead of the entire layer)?

Thread ID:

Created:

Updated:

Platform:

Replies:

149996 Dec 17,2019 12:36 PM UTC Dec 18,2019 07:26 AM UTC Angular - EJ 2 3
loading
Tags: Diagram
Mithun
Asked On December 17, 2019 12:36 PM UTC

Hello Syncfusion Team,

Per the documentation, I know it is possible to lock an entire layer of a diagramComponent.

However I just wanted to check whether individual nodes/connectors could be locked without utilizing layers. 

If not, I plan to create a new layer simply to hold "locked" objects. 

Just wondering if there is a simpler way? 

PS: Something like a diagramComponent.nodes[0].lock() method would have been ideal.

Thanks,
Mithun

Shyam G [Syncfusion]
Replied On December 18, 2019 06:56 AM UTC

Hi Mithun, 

Please set NodeConstraints None to lock an individual node and NodeConstraints Default to unlock an individual  node. Similarly, you can set ConnectorConstraints None and Default to lock and unlock a connector Please refer to a code example, sample and help documentation below. 

Code example: 
  lockObject() { 
     let node: NodeModel = this.diagram.getObject("firstNode"); 
     //disable node interaction 
     node.constraints = NodeConstraints.None; 
  

   unlockObject() { 
      let node: NodeModel = this.diagram.getObject("firstNode"); 
      //enable node interaction 
     node.constraints = NodeConstraints.Default; 
  





Regards, 
Shyam G 


Mithun
Replied On December 18, 2019 07:18 AM UTC

Thanks Shyam! This is exactly what I was looking for. 

Thanks,
- Mithun

Shyam G [Syncfusion]
Replied On December 18, 2019 07:26 AM UTC

Hi Mithun, 
Thanks for your update. 
Regards, 
Shyam G 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon