如何在我的代码中添加或删除onclick
事件的节点和链接?
这是我的{d3js)code fiddle。
如何使用:右键单击任何节点并单击删除它删除所有节点但没有链接。
但我想只删除一个节点,并点击要删除的链接。
//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');
}
}
});