updates multiple tasks/links at once
callback | function | the callback function |
noRedraw | boolean | optional, specifies if Gantt should repaint the chart after the callback function; true - not to repaint and false (by default) - to repaint |
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);
}
});
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.