I have a display network using cytoscape.js
, I want to display details from mysql table about a particular node and edge whenever the node is clicked. How can I do that?
I have used the following code which uses function cy.on
('tap'). How do I send the var node_id
to any php page which then use this node and retrieve its information from a mysql table to display the information in a particular division. This code is inside a $.getJSON
function.
cy.on('tap', 'edge', function(evt){
var edge = evt.cyTarget;
alert( 'Selected ' + edge.source() );
});
cy.on('tap', 'node', function(evt){
var node = evt.cyTarget;
alert( 'Selected ' + node.id() );
});
If i understand your question correctly, you can just send an HTTP request containing node_id to your server.
If you don't know how to do this in javascript, I suggest taking a look at the MDN page for XMLHttpRequest