DHTMLX Docs & Samples Explorer

onTaskStartResize

onTaskStartResize event is fired when user starts to resize a Task item.

One parameter is passed to the handler:

  • task - GanttTask object which is being resized.

You may return false from this handler to cancel resizing.

    ganttChartControl.attachEvent("onTaskStartResize", function(task){
        // Sample custom code for resizing
        if (task.getId()==13) {
            task._initialCompleteHours = task.getDuration() * task.getPercentCompleted() / 100;
        }
        // Disable resizing for Task with Id = 3
        if (task.getId()==3) return false;
    });