Force refresh on ajax success

Hi Everyone,

I have a form that allows for staff members to post a holiday request, on success of this form I would like the dhtmlx scheduler to update to show the requested holiday on the screen. The form posts using ajax as so:

$("#form_request_holiday").submit(function()
{
	$.post($("#form_request_holiday").attr("action"), $("#form_request_holiday").serialize(), function(data){
					
		if(data.status === "success") {
			$("#form_request_holiday").trigger("reset");
                        //UPDATE SCHEDULER HERE!!!!
		}
	
		display_message(data.status, data.msg);			
	
	},'json');
	 
	return false;
});

As shown above I’d like to update the scheduler at the point of a successful submission but i’m a little clueless how to do so. Any help would be appreciated.

Kind Regards

You can use something like next

scheduler.clearAll() scheduler.load("data.php");

if you sure that there was only addition of new events, you can use just “load” without “clearAll” ( it will look better )

Hi Thanks for the reply,

I’ve got that working by moving all my “other code” inside the init() function but for future reference is there any way I can update the scheduler from outside of the init() function.

Regards