{"action":"opened","issue":{"url":"https://api.github.com/repos/sporritt/jsPlumb/issues/541","repository_url":"https://api.github.com/repos/sporritt/jsPlumb","labels_url":"https://api.github.com/repos/sporritt/jsPlumb/issues/541/labels{/name}","comments_url":"https://api.github.com/repos/sporritt/jsPlumb/issues/541/comments","events_url":"https://api.github.com/repos/sporritt/jsPlumb/issues/541/events","html_url":"https://github.com/sporritt/jsPlumb/issues/541","id":164769207,"number":541,"title":"Get connection details","user":{"login":"NayantaraJeyaraj","id":17398536,"avatar_url":"https://avatars.githubusercontent.com/u/17398536?v=3","gravatar_id":"","url":"https://api.github.com/users/NayantaraJeyaraj","html_url":"https://github.com/NayantaraJeyaraj","followers_url":"https://api.github.com/users/NayantaraJeyaraj/followers","following_url":"https://api.github.com/users/NayantaraJeyaraj/following{/other_user}","gists_url":"https://api.github.com/users/NayantaraJeyaraj/gists{/gist_id}","starred_url":"https://api.github.com/users/NayantaraJeyaraj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NayantaraJeyaraj/subscriptions","organizations_url":"https://api.github.com/users/NayantaraJeyaraj/orgs","repos_url":"https://api.github.com/users/NayantaraJeyaraj/repos","events_url":"https://api.github.com/users/NayantaraJeyaraj/events{/privacy}","received_events_url":"https://api.github.com/users/NayantaraJeyaraj/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-07-11T06:35:17Z","updated_at":"2016-07-11T06:35:17Z","closed_at":null,"body":"Hi, \r\nI'm working with jsPlumb and Javascript to implement a simple drag and drop interface of elements where connections can be made amongst each other. I would like to know how I could get the connection details of the sources and the targets when the 'setting-like' button on each dropped element is clicked.\r\n![finally](https://cloud.githubusercontent.com/assets/17398536/16721608/425886e2-475e-11e6-969d-7b5cf4b27e47.png)\r\n\r\nIn the above canvas, if the settings icon of the \"Empty Query\" is clicked, I need to retrieve the connection info such\r\n\r\nin-connector:\r\n\r\nsource id - in connector id itself & target id- \"Pixar\" element's connector id\r\n\r\nout-connector:\r\n\r\nsource id - out connector id itself & target id- \"Paramount\" element's connector id\r\n\r\n**JS Function**\r\n\r\n    function dropCompleteQueryElement(newAgent,i,e)\r\n    {\r\n        $(droppedElement).draggable({containment: \"container\"});\r\n\r\n        var finalElement =  newAgent;\r\n        r++; q++;\r\n\r\n        var connectionIn = $('<div class=\"connectorIn\">').attr('id', i + '-in').addClass('connection').text(\"in\");\r\n        var connectionOut = $('<div class=\"connectorOut\">').attr('id', i + '-out').addClass('connection').text('out');\r\n\r\n        finalElement.css({\r\n            'top': e.pageY,\r\n            'left': e.pageX\r\n        });\r\n\r\n        finalElement.append(connectionIn);\r\n        finalElement.append(connectionOut);\r\n\r\n       $('#container').append(finalElement);\r\n\r\n       jsPlumb.draggable(finalElement, {\r\n            containment: 'parent'\r\n        });\r\n\r\n        jsPlumb.makeTarget(connectionIn, {\r\n            anchor: 'Continuous'\r\n        });\r\n\r\n        jsPlumb.makeSource(connectionOut, {\r\n            parent:finalElement,\r\n            anchor: 'Continuous'\r\n        });\r\n\r\n        var myNode = document.getElementById(\"lot\");\r\n        var fc = myNode.firstChild;\r\n\r\n        while( fc ) {\r\n            myNode.removeChild( fc );\r\n            fc = myNode.firstChild;\r\n        }\r\n\r\n    }\r\n\r\nI've attached the project [here](https://github.com/NayantaraJeyaraj/SiddhiEdit)\r\n"}}
{"actor":{"display_login":"NayantaraJeyaraj"}}