drag_link

specifies the text of tooltips that are displayed when the user creates a new dependency link

fromstring|numberthe id of the source task
from_startbooleantrue, if the link is being dragged from the start of the source task, false - if
from the end of the task
tostring|numberthe id of the target task( 'null' or 'undefined', if the target task isn't specified yet)
to_startbooleantrue, if the link is being dragged to the start of the target task, false - if
to the end of the task

Example

gantt.templates.drag_link = function(from, from_start, to, to_start) {
    const sourceTask = gantt.getTask(from);
 
    let text = `From:<b> ${sourceTask.text}</b> ${(from_start?"Start":"End")}<br/>`;
    if(to){
        const targetTask = gantt.getTask(to);
        text += `To:<b> ${targetTask.text}</b> ${(to_start?"Start":"End")}<br/>`;
    }
    return text;
};

See also
Back to top