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

How to detect node lane change


If I drag a shape from one lane and drop it into another the drop event is fired.
This is good.
How can I quickly determine what lane the node is now placed in?
I could iterate through all lanes in the swimlane and examine each child node to see if it matches the one I just dropped, but that sounds like overkill. 
Is there not a simpler way to get the node's parent lane?

Also, if I nudge the shape using the keyboard arrow keys I can move a node from one lane to another, but since there is no event for this (a feature I am waiting for), I cannot detect a lane change.

Any suggestions on how to determine the node's parent lane in the drop event handler?



1 Reply

SG Shyam G Syncfusion Team July 21, 2015 08:11 AM UTC

Hi Jim

Thanks for using Syncfusion products.

Please note that you can find the parent node using the nodes “parent” property and we suggest you to use drag event to achieve your requirement.  Please refer the code snippet below.

Code snippet:

DiagramContent.OnClientDrag = "drag";

function drag(args) {            

            var diagram = $("#diagram").ejDiagram("instance");

            //args.element has the current node(Ex:rectanglenode)

            var node = args.element;

            if (node && args.elementType === "node") {

                //returns the parent element(lane)

                var parent = diagram.findNode(args.element.parent);


Please let me know if any concerns.

Shyam G

Live Chat Icon For mobile
Up arrow icon