Skip to content

Instantly share code, notes, and snippets.

@godbout
Created May 16, 2011 05:07
Show Gist options
  • Save godbout/973961 to your computer and use it in GitHub Desktop.
Save godbout/973961 to your computer and use it in GitHub Desktop.
fullCalendar, send all events to web server through ajax
var calendar = $('#cal').fullCalendar({
...
eventDrop: function(event, dayDelta, minuteDelta, allDay, revertFunc) {
$.post("<?php echo url_for('@section_update_schedule?id=' .$section['id']) ?>", { events: JSON.stringify(calendar.fullCalendar('clientEvents')) }, function(data) {
if (data != 'success')
revertFunc();
}, 'json');
console.log(calendar.fullCalendar('clientEvents'));
console.log(JSON.stringify(calendar.fullCalendar('clientEvents')));
}
});
@gokturksigirtmac
Copy link

Very nice. Firstly thanks. But I didn't upload data. How can I ? I used
`events : [

          $.ajax({
            url:'data.php',
            type:'get',
            dataType: 'json',
            success: function(x){
              console.log(x); 
            }
          })

      ],`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment