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?










1















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?










share|improve this question




























    1















    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?










    share|improve this question


























      1












      1








      1








      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?










      share|improve this question
















      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






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Mar 7 at 18:25









      Scooter Morris

      32113




      32113










      asked Mar 7 at 12:17









      Jose ClaveroJose Clavero

      82




      82






















          1 Answer
          1






          active

          oldest

          votes


















          1














          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.






          share|improve this answer






















            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
            );



            );













            draft saved

            draft discarded


















            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









            1














            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.






            share|improve this answer



























              1














              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.






              share|improve this answer

























                1












                1








                1







                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.






                share|improve this answer













                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.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered 2 days ago









                Stephan T.Stephan T.

                1,2361821




                1,2361821





























                    draft saved

                    draft discarded
















































                    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.




                    draft saved


                    draft discarded














                    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





















































                    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







                    Popular posts from this blog

                    How to get text form Clipboard with JavaScript in Firefox 56?How to validate an email address in JavaScript?How do JavaScript closures work?How do I remove a property from a JavaScript object?How do you get a timestamp in JavaScript?How do I copy to the clipboard in JavaScript?How do I include a JavaScript file in another JavaScript file?Get the current URL with JavaScript?How to replace all occurrences of a string in JavaScriptHow to check whether a string contains a substring in JavaScript?How do I remove a particular element from an array in JavaScript?

                    Can't initialize raids on a new ASUS Prime B360M-A motherboard2019 Community Moderator ElectionSimilar to RAID config yet more like mirroring solution?Can't get motherboard serial numberWhy does the BIOS entry point start with a WBINVD instruction?UEFI performance Asus Maximus V Extreme

                    List of MPs elected to the English parliament in 1640 (April) Contents List of constituencies and members See also Notes References Navigation menueNational Archives – The Glynde Place ArchivesCobbett's Parliamentary history of England, from the Norman Conquest in 1066 to the year 1803'Aldermen in Parliament', The Aldermen of the City of London: Temp. Henry III – 1912onepage&q&f&#61, false 229