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

Connector totals don't add up when adding connector target as end node.

Hi 

I've been trying to make use of the nodes and connectors and noticed that the numbers don't match up to what is in the grid. Below is an example where i have 3 nodes and 2 connectors. 



When i click on Check Numbers it will fire a method which will tell me the number of nodes and number of connectors in an alert



AS you can see from the above image the nodes is correct but connectors is wrong, when debugging i noticed that the one that is missing is going between my activity and end node. Also while debugging ive noticed that if i had more than 1 going to end node sometimes a connector is added which both the source and target node being null. Is this expected? 


My project was too big to put in so please find attached in the following URL, this was made using Visual Studio Code

https://1drv.ms/u/s!AgxIdbDPqmRThVbv_KJjsCwduwsj

Thanks
Robert


3 Replies

SG Shyam G Syncfusion Team May 25, 2017 09:10 AM UTC

Hi Robert, 
 
Please use diagram.model.nodes.length and diagram.model.connectors.length to get the nodes and connectors count respectively and should not use diagram._nodes.length and diagram._connectors.length because it’s an private API used internally. Please refer to the modified code example 
 
Code example: 
 
private checkNumbers() {       
     var diagram = $("#diagramCore").ejDiagram("instance"); 
     alert("Nodes: " + diagram.model.nodes.length + ". Connectors: " + diagram.model.connectors.length); 
 } 
 
Regards, 
Shyam G 



RW Robert Williamson May 25, 2017 10:59 AM UTC

Hi Shyam

Thanks using model instead works as expected

Thanks
Robert



SG Shyam G Syncfusion Team May 26, 2017 03:57 AM UTC

Hi Robert, 
Please let us know if you need further assistance on this. 
Regards, 
Shyam G 


Loader.
Live Chat Icon For mobile
Up arrow icon