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 there a way to restrict drag of individual node from pallette

Thread ID:

Created:

Updated:

Platform:

Replies:

149127 Nov 15,2019 07:40 AM UTC Dec 5,2019 12:00 PM UTC React - EJ 2 8
loading
Tags: Diagram
Sudhanshu Jain
Asked On November 15, 2019 07:40 AM UTC

 Hi,

Can we disable drag for a specific node within the nodepanel?

Regards,
Sudhanshu

Shyam G [Syncfusion]
Replied On November 18, 2019 05:03 AM UTC

Hi Sudhanshu, 
 
We suspect that you need to disable drag for a specific node in the group. If so, please remove NodeConstraints Drag from the NodeConstraints Default to achieve your requirement. Please refer to a code example and sample below. If we misunderstood your requirement, please share us more details such as elaborate your requirement in detail with screenshot? 
 
Code example: 
let nodes = [{ 
  id: "rectangle1", 
  offsetX: 100, 
  offsetY: 100, 
  width: 100, 
  height: 100, 
  annotations: [{ 
    content: 'rectangle1' 
  }] 
}, { 
  id: "rectangle2", 
  offsetX: 200, 
  offsetY: 200, 
  width: 100, 
  height: 100, 
  //remove drag constraints 
  constraints: NodeConstraints.Default & ~NodeConstraints.Drag, 
  annotations: [{ 
    content: 'rectangle2' 
  }] 
}, 
//create group element 
{ 
  id: 'group2', 
  children: ['rectangle1', 'rectangle2'] 
} 
]; 
 
 
 
Regards, 
Shyam G 


Sudhanshu Jain
Replied On November 18, 2019 08:31 AM UTC

Hi Shyam,

I was referring to Symbol palette nodes, not within canvas. Please let me know regarding restriction of drag of a specific node within Symbol palette.

Thanks

Shyam G [Syncfusion]
Replied On November 19, 2019 08:40 AM UTC

Hi Sudhanshu, 
 
In the symbol palette component we can restrict dragging of all shapes, not an individual shape. To prevent dragging of the shape from the symbol palette, please set allowDrag property as false.. Please refer to a code example and sample below. 

Code example: 
<SymbolPaletteComponent id="symbolpalette" expandMode="Multiple" allowDrag={false}/> 
 

 
Regards, 
Shyam G 


Sudhanshu Jain
Replied On November 19, 2019 09:09 AM UTC

Hi Shyam,

Yes, i had check allowDrag property but i want to restrict the drag of individual node/shape within symbol palette.
Please let me know if the same can be handled.

Thanks

Shyam G [Syncfusion]
Replied On November 20, 2019 05:07 AM UTC

Hi Sudhanshu, 

We don’t have an option to restrict individual shape in the symbol palette. Please share your scenario why you need to restrict individual shapes in the symbol palette. So that we can validate it further and provide an update on it. 

Regards, 
Shyam G 


Sudhanshu Jain
Replied On November 20, 2019 08:18 AM UTC

Hi Shyam,

In a flow , we can not have more than one start/end node. So if those nodes already exists then we want to display start and end node in the symbol palette but we want to restrict the drag of that node.

Thanks

Shyam G [Syncfusion]
Replied On November 21, 2019 07:09 AM UTC

Hi Sudhanshu, 

On analyzing your scenario, we suggest you to use diagram collectionChange event in which we can set args.cancel=true for a particular node to prevent it from dropping onto the diagram. We have an issue in it and logged “Unable to remove connectors that are drawn at runtime in the collectionChange” a defect report. The fix for this issue is estimated to be available on 3rd December, 2019. 
 
You can track the status of the issue from the below feedback link. 
 

Regards, 
Shyam G 


Shyam G [Syncfusion]
Replied On December 5, 2019 12:00 PM UTC

Hi Sudhanshu,  
  
Reported Issue : Unable to remove connectors that are drawn at runtime in the collectionChange. 
  
We are glad to announce that our patch release (v17.3.29) is rolled out successfully and In that release, we have added the fix for reported issue.      
       
Please upgrade to the latest version packages to resolve this issue.       
 
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