NorthwoodsSoftware / GoJS

JavaScript diagramming library for interactive flowcharts, org charts, design tools, planning tools, visual languages.
http://gojs.net
Other
7.8k stars 2.86k forks source link

When you press Delete to delete a connector between nodes, is there a callback method to know which connector is currently deleted? #149

Closed BoLin6 closed 3 years ago

BoLin6 commented 3 years ago

this.myDiagram.commandHandler.deleteSelection = function () { to do something } This method has no callback parameters and does not know which connection line is currently deleted

simonsarris commented 3 years ago

You can use the "SelectionDeleted" Diagram Event:

https://gojs.net/latest/intro/events.html#SelectionDeleted

For example:

      myDiagram.addDiagramListener("SelectionDeleted", function(e) {
        e.subject.each(function(part) {
          // do something with each deleted Part (Node or Link)
        });
      });

Do not use this issue tracker for support. Use the Forum