score:8

Accepted answer

You seemed to be trying to do some kind of nested dragging or something, the following should work:

 var drag1 = d3.behavior.drag()
    .on("drag", dragmove)
    .on("dragend", function () { alert("drag ended"); });

Full example: http://jsfiddle.net/xnjGD/

score:0

Quick mention if anyone still needs something like this, d3.behaviour was deprecated as well as dragend. If you still need the functionality it should look something like this:

d3.drag().on("end", (_event, dimension) => {
    console.log("alert ended for : " dimension)
  })

(for more informations: https://github.com/d3/d3/blob/master/CHANGES.md#dragging-d3-drag)


Related Query

More Query from same tag