drag_link

定义在创建新依赖链接时显示的tooltip文本

fromstring|number源任务的ID
from_startbooleantrue 表示链接是从源任务的开始端拖动,false 表示从结束端拖动
tostring|number目标任务的ID(如果目标任务尚未指定,则为 'null' 或 'undefined')
to_startbooleantrue 表示链接拖动到目标任务的开始端,false 表示拖动到结束端

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