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 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 
    console.log(connector.sourceID); 
    //get targetNode id 
     console.log(connector.targetID); 
 
}  


Regards, 
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. 
Regards, 
Shyam G 


Loader.
Up arrow icon