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. Image for the cookie policy date

validation of connectors

Hi,


I want to make sure the connectors are connected to the nodes. I mean I want to validate all connectors have target process and source process. how can I validate in front-end?

Thanks.

3 Replies

SG Shyam G Syncfusion Team September 23, 2019 10:44 PM

Hi Aung, 

The connectors sourceID and targetID  properties are used to determine the connection established between the sourceNode and targetNode respectively. These properties will have a node id.  Please refer to a code example below. 

Code example: 
//create button 
<input type="button" value="getConnectors" onclick="getConnectors()"/> 

//method called on button click 
function getConnectors() { 
  var diagram = document.getElementById("diagram").ej2_instances[0]; 
  //get connectors in diagram 
  var connectors = diagram.connectors; 
  //iterate connectors 
  for( var i=0; i <connectors.length; i++) { 
    var connector = connectors[i]; 
    //get sourceNode id 
    console.log(connector.sourceID); 
    //get targetNode id 
     console.log(connector.targetID); 
 
}  


Regards, 
Shyam G 



AM Aung Myo September 23, 2019 11:34 PM

Hi Shyam,

Thanks for your reply. That's exactly what I want. Thank you very much!


SG Shyam G Syncfusion Team September 24, 2019 12:53 AM

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


Loader.
Live Chat Icon For mobile
Up arrow icon