batchUpdate

updates multiple tasks/links at once

void batchUpdate(function callback);

Parameters

callbackfunctionthe callback function

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