Timeline, Mulitple Loading

Hi Everyone, I’m pretty new to Scheduler but basically I’m working in timeline view and I have some very custom requirements. Rather than loading all events in the database in one go I’d rather load the relevant events on view change hence the following code

scheduler.attachEvent("onViewChange", function (new_mode , new_date){
		var dateToStr = scheduler.templates.load_format;
		scheduler.load("/index.php/control_panel/diary_functions/ajax_get_rentals_in_date_range?from="+dateToStr(scheduler.getState().min_date)+"&to="+dateToStr(scheduler.getState().max_date), "json");		
});

scheduler.attachEvent("onXLS", function (){
		scheduler.clearAll();
});

The problem I have is if I change the view multiple times in quick succession it runs the code that amount of times also therefore adding multiple copies of the same event. Is there anyway I can either cancel the previously called events ie. unbind, or stop the scheduler from accepting duplicate events.

Thanks in advance

Check that all events have “id” property, and it is consistent between calls. ( scheduler will not create new event if it already has event with the same ID )

Also, check the Dynamical Loading mode
docs.dhtmlx.com/scheduler/loadin … micloading

Perfect, thanks for the response, worked straight away.