ConnectionChange Event

Hi, we have an issue where the connectionChange event seems to be firing many, many times.

In the below screenshot, we have moved the end point of the connector to the square.


We have hooked the connectionChange event with the following....

connectionChange: function (evtArgs) {
if (evtArgs.state === "Changing"){
if (evtArgs.connector != null) { // && evtArgs.newValue.connectorTargetValue!=null) {
//if (oldValue != null && oldValue.nodeId === "") {
//}
console.log(evtArgs.connector.sourceID + " - " + evtArgs.connector.targetID);
}
}
}

This results in the following....

My issues are:
  1. Why are the events being fired many, many times (we have about 20 times). This is the same for the 'Changed' state too.
  2. Why do half of these events have a sourceID defined whilst the other half do not.
Many Thanks




4 Replies

SK Suganthi Karuppannan Syncfusion Team March 2, 2020 09:04 AM UTC

Hi James Hutchison, 
 
We are able to reproduce the reported issue at our end. We are validating your issue and update you with more details on 4th march 2020. 
 
Regards, 
Suganthi K. 



SG Shyam G Syncfusion Team March 5, 2020 12:53 PM UTC

Hi James, 
 
Sorry for the inconvenience. 
 
Query 
Response 
  1. Why are the events being fired many, many times (we have about 20 times). This is the same for the 'Changed' state too.
The connectionChange event gets triggered only once at the changed state. Please refer to a sample and the video below for your reference. In the changing state, the event will be triggered many times and it is a behavior of our control. 
 
 
 
  1. Why do half of these events have a sourceID defined whilst the other half do not.
We don’t have sourceID property in the event arguments except in the connector object. Could you please share us more details such as where do you find this property in the event and share us a screenshot. 
 
 
Regards, 
Shyam G 



JH James Hutchison March 5, 2020 01:45 PM UTC

Suganthi, thanks for the reply.

In your original response you said you were able to reproduce the issue?

Attached is a sample application which, if you change one of the connections you will be able to see the issue. Perhaps the issue is to do with SVG images?

Thanks

Attachment: diag_86faa0b7.zip


SG Shyam G Syncfusion Team March 6, 2020 09:43 AM UTC

Hi James.  
  
By analyzing your sample, we found that you are using the older version of ej2.min.js file, so only the connection change event’s changed state has called multiple times. We have fixed it in our latest version. We have modified your sample with the latest ej2.min.js file and provided the sample link below.  
  
 
 
Regards,  
Shyam G 


Loader.
Up arrow icon