How to get the id of the node where I drop the node that I am dragging2019 Community Moderator Electionselecting nodes vs. dragging the graph in cytoscape.jsExample on matching direct children of the parent node in cytoscape.jsHow to make child nodes not individually draggable?How to lock the position of a cytoscape.js node within its parent nodeDrag event for nodes in Cytoscape.jsIs there a way to drag and drop nodes into or out of other nodes in Cytoscape js?Grab compound nodes when a child node is grabbed cytoscape.jsCustom node renderer for Cytoscape + restrict drag pointsHow to layout breadthfirst with compound nodes in Cytoscape?How to reset cytoscapes 'tap', 'grap' and 'mouseover' events for certain nodes, so that links, buttons and fields work with html labels?
Why are the outputs of printf and std::cout different
Is having access to past exams cheating and, if yes, could it be proven just by a good grade?
Is it possible that AIC = BIC?
Font with correct density?
What is a good source for large tables on the properties of water?
Should we release the security issues we found in our product as CVE or we can just update those on weekly release notes?
Official degrees of earth’s rotation per day
Why do Australian milk farmers need to protest supermarkets' milk price?
Employee lack of ownership
Can elves maintain concentration in a trance?
Professor being mistaken for a grad student
Co-worker team leader wants to inject his friend's awful software into our development. What should I say to our common boss?
How to simplify this time periods definition interface?
Instead of Universal Basic Income, why not Universal Basic NEEDS?
An Accountant Seeks the Help of a Mathematician
In-house repeater?
How do I hide Chekhov's Gun?
Connecting top and bottom SMD component pads using via
How to make healing in an exploration game interesting
Why must traveling waves have the same amplitude to form a standing wave?
What interface is this on my hard drive?
Where is the 1/8 CR apprentice in Volo's Guide to Monsters?
Counting certain elements in lists
Know when to turn notes upside-down(eighth notes, sixteen notes, etc.)
How to get the id of the node where I drop the node that I am dragging
2019 Community Moderator Electionselecting nodes vs. dragging the graph in cytoscape.jsExample on matching direct children of the parent node in cytoscape.jsHow to make child nodes not individually draggable?How to lock the position of a cytoscape.js node within its parent nodeDrag event for nodes in Cytoscape.jsIs there a way to drag and drop nodes into or out of other nodes in Cytoscape js?Grab compound nodes when a child node is grabbed cytoscape.jsCustom node renderer for Cytoscape + restrict drag pointsHow to layout breadthfirst with compound nodes in Cytoscape?How to reset cytoscapes 'tap', 'grap' and 'mouseover' events for certain nodes, so that links, buttons and fields work with html labels?
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?
cytoscape.js
add a comment |
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?
cytoscape.js
add a comment |
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?
cytoscape.js
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?
cytoscape.js
cytoscape.js
edited Mar 7 at 18:25
Scooter Morris
32113
32113
asked Mar 7 at 12:17
Jose ClaveroJose Clavero
82
82
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
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.
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55043592%2fhow-to-get-the-id-of-the-node-where-i-drop-the-node-that-i-am-dragging%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
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.
add a comment |
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.
add a comment |
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.
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.
answered 2 days ago
Stephan T.Stephan T.
1,2361821
1,2361821
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55043592%2fhow-to-get-the-id-of-the-node-where-i-drop-the-node-that-i-am-dragging%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown