How to set connector constraints dynamically

Can I get some use case for how do I attach this in to connector constraints  ConnectToNearByPort

1 Reply 1 reply marked as answer

GG Gowtham Gunashekar Syncfusion Team January 18, 2021 12:54 PM UTC

Hi sunil, 
 
We have added the sample link to demonstrate how to change the connector constraints dynamically. 
 
 
var diagram = this.$refs.diagram.ej2Instances; 
diagram.connectors[0].constraints =  (ConnectorConstraints.Default & ~ConnectorConstraints.ConnectToNearByNode); 
diagram.dataBind(); 
 
 
ConnectToNearByPort used cases: 
 
We have a property named as “connectionPadding”, to connect the nearby element before some predefined padding while dragging the connector’s end point. By default the nearby connection is “ConnectToNearByElement” which means it connects to both nearby node and nearby port. We can use connector constraint to connect with nearby node or nearby port. We have added a video demonstration to show how its work. 
 
 
Regards 
Gowtham 
 


Marked as answer
Loader.
Up arrow icon