Context menu for dependency links


Can we create a context menu for dependency links? We need to be able to have add/edit/delete options when we right click the dependency link.



The gantt library doesn’t have a built-in context menu component, so you’ll have to use a 3rd party library for it.

As for capturing the right-click event, you can use “onContextMenu” event of the gantt and call the context menu from the handler

returning ‘false’ from the handler will prevent the native menu:

gantt.attachEvent("onContextMenu", function (taskId, linkId, event) {
    var element =;
       alert("right click on link " + linkId);
       return false;// prevent native context menu
    return true;