Created
May 16, 2011 05:07
-
-
Save godbout/973961 to your computer and use it in GitHub Desktop.
fullCalendar, send all events to web server through ajax
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'))); | |
} | |
}); |
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
Thanks man!!