only one input connector

there is a way to connect at most one input connector to a node? 
There is an event that triggers with the attachment connector to a node or do I have to manage the connector with drop and connectionChange events??

Thank you

1 Reply

SK Suganthi Karuppannan Syncfusion Team March 4, 2020 12:41 PM UTC

Hi Federica Chiuchiarelli,   
   
We can able to achieve your requirement by using the “connectionChange” event. Using the event, you can able to get the target element under mouse in each connection change. When the target should be the nodes, we can able to get the number of in edges or out edges was connected already from target. So based on the length of the in or out edges we can able to achieve your requirement. Please refer to the below code snippet for how to use the “connectionChange” event in a diagram.   
   
function connectionChange(args) {   
     if(args.state === "Changing" && args.connectorEnd === "ConnectorTargetEnd"){   
       if(args.newValue.nodeId !== ""){   
         var node = diagram.getObject(args.newValue.nodeId);   
         if(node.inEdges && node.inEdges.length > 0){   
           args.cancel = true;   
         }   
       }   
     }   
    }   
   
   
For more information about “ConnectionChangeEventArgs” please refer the below documentation link.   
   
   
We have attached the sample for your further reference. Please refer the below sample link.   
   
   
   
Regards,   
Suganthi K.  


Loader.
Up arrow icon