onBeforeTaskDrag

当用户按下鼠标按钮并开始拖动时立即触发,但在 dhtmlxGantt 开始拖放过程之前。

boolean onBeforeTaskDrag(string|number id,string mode,Event e);
idstring|number任务的 id
modestring拖放模式("resize"、"progress"、"move"、"ignore")
eEvent原生事件对象
boolean决定是否允许默认事件动作继续执行(true)或阻止其执行(false

Example

gantt.attachEvent("onBeforeTaskDrag", function(id, mode, e){
    // 在这里添加自定义逻辑
    return true;
});

Related samples

Details

当任务在时间轴内被拖动时触发此事件。

返回 false 可阻止拖动操作,任务将重置回其原始位置。

See also
Back to top