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
close icon

Cannot remove nodes because of InEdges with name "helper"

Hello,

We do have problems with removing nodes on the ejDiagram.
This happens when a user first tried to draw new edges to a node but the connecting is prevented in the "connectionChange"-event (by args.cancel = true, e.g. to avoid connecting to a specific port).
This causes the generation of many "InEdges" with the name "helper" that are not cleaned-up.
Those helper-edges generate an error when the node is removed.

How could this be avoided and still use the possibility to cancel specific connectors being connected on the "connectionChange"-event?
An example to reproduce the error is given here: http://jsplayground.syncfusion.com/fvcffhbc

Best regards,
Tycho


ejDiagram version: 13.4.0.53

1 Reply

SG Shyam G Syncfusion Team February 26, 2016 11:19 AM UTC

Hi Tycho,

Please use connectorSourceChange and connectorTargetChange event to achieve your requirement. please refer to the code example below.

$("#diagram").ejDiagram({

      //define connectorTargetChange event

        connectorTargetChange: connectionchange,

         //define connectorSourceChange event

        connectorSourceChange: connectionchange,

   });


       function connectionchange(args) {

                    if (args.node || args.port)

                        args.cancel = true;
    }

JSPlayground link:http://jsplayground.syncfusion.com/2jxuchme

Regards,
Shyam G


Loader.
Live Chat Icon For mobile
Up arrow icon