I’m currently completely customizing the lightboxcontrol, hooking into the ‘onBeforeLightbox’ event which loads a jQuery dialog box and a custom Partialview through asp.net mvc.
After saving the custom form, I’m updating the event server side and use the SchedulerFormResponseScript to sent back a correct answer. How can I feed this info back to the scheduler control using javascript so the event is updated client-side? Is there an method available on the scheduler-object?
I’m thinking something like: scheduler.update_using_responsescript(response);
See code below:
[code]scheduler.attachEvent(“onBeforeLightbox”, function (id){
var ev = this.getEvent(id);
$.ajax({
type: "POST",
contentType: "application/json; charset=utf-8",
url: "/Scheduler/Scheduler/LightboxControl",
data: JSON.stringify({ start_date: ev.start_date, end_date: ev.end_date, text : ev.text, id: ev.id, roomId: ev.roomid}),
dataType: "html",
success: function(data) {
$("#dialog-scheduler").html(data);
$("#dialog-scheduler").dialog({ height: 380, width: 350, modal: true, resizable: false,
buttons: [
{ text: 'Doorgaan', "class": 'btn-action btn-primary', click: function() {
$.post($("#formSchedulerEvent").attr("action"), $("#formSchedulerEvent").serialize(), function(response) {
/feed the scheduler object the xml-response so it updates the event
});
$(this).dialog("close");
} },
{ text: 'Annuleren', "class": 'btn-action', click: function() { $(this).dialog("close"); return false; } }
]
});
}
});
return false;
});[/code]