I am using DiagramListener for deleting selected objects from diagram “SelectionDeleted”, now when i create two nodes connect them with link and try to select one node and delete, the e.subject.count inside SelectionDeleted is giving 2 where i just deleted one node.
var selectionDeleteHandler = function (diagram) {
diagram.addDiagramListener(“SelectionDeleted”, selectionDelete);
};
var selectionDelete = function (e) {
console.log(“Selection Deleted”, e.subject);
};
If I understand the situation, that sounds like the correct behavior. Two Parts are being deleted: a Node and a Link, because the default policy is to delete connected Links rather than leave them dangling. Naturally the listener may want to know about all of the Parts that were deleted.
I do also want to remove the link too,
For multi select I’m using e.subject.each inside selectionDelete, is there a way where maybe i could only be able to record deleted nodes, maybe something like subject.eachNode