batchUpdate

updates multiple events at once

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

Example

scheduler.batchUpdate(function(){
    const events = scheduler.getEvents();
    for(var i = 0; i < events.length; i++){
        const event = events[i];
        event.start_date = scheduler.date.add(event.start_date, 1, "day");
        event.end_date = scheduler.date.add(event.end_date, 1, "day");
        scheduler.updateEvent(event.id);
    }
});

Details

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

See also
Back to top