Reputation: 85
I am trying to use the compound-drag-and-drop extension of cytoscape to create an event where I need the id of the node where I am dropping the node that I am dragging. Instead the id that I am getting is a "parent" auto generated by the extension. Is there a way to get the id of my node so I can bind both of them when I drop the first one into the second one?
Upvotes: 1
Views: 139
Reputation: 6074
I think that is exactly what the custom event
cy.nodes().bind('cdnddrop', function (event, target){
var grabbedNodeID = event.target._private.data.id;
var droppedNodeID = target._private.data.id;
});
does, so try it out and see if it helps you.
Upvotes: 2