user469652
user469652

Reputation: 51221

jQuery Full Calendar: How to update calendar after completed ajax call?

eventDrop: function(event, dayDelta, revertAction) {
    $.post("/calendar/",{id: event.id } , 
        function(result) {
            if (result == "succeed"){
                alert('succeed');
            }
            else{
                alert("Server error, Please try again");
            }
         },"json");
}

So in this method, I have an ajax call. I want the calendar to only be updated when success is returned from the server, otherwise it does nothing. How is this kind of code written?

Upvotes: 4

Views: 8445

Answers (2)

Wolfeh
Wolfeh

Reputation: 36

http://arshaw.com/fullcalendar/docs/event_rendering/rerenderEvents/

.fullCalendar( 'rerenderEvents' )

Upvotes: 2

user180100
user180100

Reputation:

$.post("/calendar/", {id: event.id }, 
    function (data, textStatus, XMLHttpRequest) {
        // use data if textStatus == 200
    },
    "json"
);

?? see jQuery.post() documentation

Upvotes: 0

Related Questions