Tuesday, 6 August 2013

Fullcalendar Event drop and ajax

Fullcalendar Event drop and ajax

I'm currently working with the great Jquery plugin - Fullcalendar but I'm
encountering a problem. I use the eventDrop listener and I want to send
the event information using Ajax to my server side.
My code is the following :
eventDrop: function (event, dayDelta) {
$.ajax({
url: ("/PSAdmin/RFCalendar/DragEvent"),
data: ({
type: event.className,
delta: dayDelta,
newDate: event.start,
newTitle: event.title
}),
type: "POST",
success: function (data) {
$('#calendar').empty();
loadCalendar();
},
error: function (xhr, status, error) {
alert("fail");
}
});
}
My problem is that as soon as I try to send any variable contained into
the event object, it doesn't work. For example sending only dayDelta to
the server side works, but none of the event.something does.
If anyone stumbled on this problem before or if you have any idea what
could cause the problem, please let me know.

No comments:

Post a Comment