0
我使用cytoscape-cxtmenu.js
在節點上提供命令,但並非所有節點都支持所有命令。 如何只顯示節點支持的命令?Cytoscape.js:根據節點隱藏cxtmenu條目?
var defaults = {
selector: 'node',
commands: [
// everyone has a name
{content: 'tell name',
select: function(node) {console.log(node.data().name);}},
// not everyone has a spouse
{content: 'tell spouse',
select: function(node) {console.log(node.data().spouse);}},
]};
var cxtmenuApi = cy.cxtmenu(defaults);