Open jeandav opened 5 years ago
Did you try the following approach?
getSelectedNodes()
to get an array of selected node ids in the form: [nodeId1, nodeId2, ...]
nodeId
that you want to deselect using the approach of your choice.unselectAll()
setSelection()
to select the object having their id in the array.I haven't tried this myself. I just came up with it based on what I found in the documentation.
The setSelecton()
accepts an option object that looking like this ...
{
unselectAll: Boolean,
highlightEdges: Boolean
}
Again, I haven't tested it, but if you set unselectAll
to true
, maybe you will not need to call the unselectAll()
function at step 3.
I want to create a function which will deselect the selected nodes in the network. I tried
network.deselectNode();
, however, I can't figure out how to trigger an event from a function.