This is my code,I will right click one node and a dialog will display, and then I will check the checkbox in this dialog to hide this one. However, it seems every time when I right click more than one node (not check the checkbox for previous node but check the checkbox of current node), it will hide all of previously right-clicked ones instead of only hiding the current right-clicked one. Here is the code:
cy.on('cxttap','node',function(e) {
var target = e.cyTarget;
//after clicking node, display dialog, where a checkbox is shown.
$("#dialog-rightClick").dialog({
width:250,
title:target.id(),
position:{my: 'left',at: 'right',of:e}
});
//checkbox, if checked, hide the node, otherwise,show all nodes
$('#hdNode').change(function(){
if(this.checked){
// for (var i=0;i<target.length;i++)
//{
// console.log(target[i].data());
// }
target.hide();
}
else{
target.show();
}
});
Is there someone help me out? Thanks very much