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


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?


3 Replies

SG Shyam G Syncfusion Team September 24, 2019 06:44 AM UTC

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 
    //get targetNode id 

Shyam G 

AM Aung Myo September 24, 2019 07:34 AM UTC

Hi Shyam,

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

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

Hi Aung, 
Thanks for your update. 
Shyam G 

Live Chat Icon For mobile
Up arrow icon