如何onclick
在我的代码中添加或删除带有事件的节点和链接?
如何使用:右键单击任何节点并单击删除它删除所有节点但没有链接。
但我只想删除一个节点,它是点击删除的链接。
//right click menu items
$('g.node').contextMenu('cntxtMenu',
{
itemStyle:
{
fontFamily : 'Arial',
fontSize: '13px'
},
bindings:
{
'open': function(t) {
alert(t.__data__.name);
},
'email': function(t) {
alert('Trigger was '+t.__data__.name+'\nAction was Email');
},
'save': function(t) {
alert('Trigger was '+t.__data__.name+'\nAction was Save');
},
'delete': function(t) {
$('g.node').remove();
//alert('Trigger was '+t.__data__.name+'\nAction was Delete');
}
}
});