Since yesterday I am looking for a way to save (mysql + php) dragged and re-sized items with jQuery fullcalendar. There are no tutorials and just a few examples. Can someone post his working json.php, json-events.php and external database update scripts? Or guide me to the best explanations, tutorials or examples?
I'm trying to get this fully working
all help much appreciated!
it may not fully answered your question, but hope this will point you to the right direction. Basically I'm trying to do the same thing but in ASP .NET, using the calendar as the data manipulator and somehow capture the updated events from the calendar and send back to the server for updates.
I noticed that there are a few event callbacks which might be useful.
The eventDrop callback - fired when an event is dropped/moved on the calendar http://arshaw.com/fullcalendar/docs/event_ui/eventDrop/
The eventResize callback - fired when an event is resized http://arshaw.com/fullcalendar/docs/event_ui/eventResize/
I suppose you could then make ajax calls to the server with the involved events detail in order to update the events accordingly.
Full Calendar v4 with help from the documentation
inside your calendar options
eventDrop: function(info) {
if(!confirm("Are you sure about this change?")) {
info.revert();
}
modifyEvent(info.event);
update using ajax
<script>
function modifyEvent(event) {
var start = event.start;
var end = event.end;
$.ajax({
type:"POST",
url:"/appointment/update",
data:{"id":event.id,"start":start,"end":end},
traditional:true,
success:function(msg){
console.log(msg);
},
error:function(msg){
console.log(msg);
alert('We are unable to process your request');
}
});
}
</script>