I am trying to get all information from selected node in my graph (using cytoscape js) to build an information table (as I used to do with cytoscape web - flash version) but I don't find a way for doing it using the js version. (I am super new to jquery / javascript ).
Trying to use this example:
cy.on('select', 'node', function(event){
// cyTarget holds a reference to the originator
// of the event (core or element)
var evtTarget = event.cyTarget;
window.evtTarget = evtTarget;
createTable(evtTarget);
if( evtTarget === cy ){
//console.log('click on background');
} else {
//console.log('click on some element');
//console.log("clicked on " + evtTarget.data("id"));
}})
I call my createTable() function with the evtTarget (node data) as parameters, but as one might know it calls my createTable() function for every node selected.
What I need is to get all selected node data, and then call my function (I tried to use a collection, but not working so far).
Could someone please help me finding a way to obtain all selected / clicked nodes and then calling a function with this data ?
I DO appreciate any help.