batchUpdate

updates multiple tasks/links at once

void batchUpdate(function callback, [boolean noRedraw] );
callbackfunctionthe callback function
noRedrawbooleanoptional, specifies if Gantt should repaint the chart after the callback function; true - not to repaint and false (by default) - to repaint

Example

gantt.batchUpdate(function () {
    var tasks = gantt.getTaskByTime();
    for(var i = 0; i < tasks.length; i++){
        var task = tasks[i];
        task.start_date = gantt.date.add(task.start_date, 1, "day");
        task.end_date = gantt.calculateEndDate(task.start_date, task.duration);
        gantt.updateTask(task.id);
    }
});

Related samples

Details

You can use this method to update multiple tasks/links at once with a single re-rendering instead of making multiple updates with multiple re-renderings.

See also
Back to top