samedi 27 décembre 2014

fullcalendar js eventResize eventDrop event.end is null bug


Seems to be the same issue with eventResize and eventDrop



eventResize: function(event, delta) {
$.ajax({
url: 'schedule/update',
data: 'title='+ event.title+'&start='+ moment(event.start).format("YYYY-MM-DD HH:mm:ss") +'&end='+ moment(event.end).format("YYYY-MM-DD HH:mm:ss") +'&id='+ event.id ,
type: "POST",
success: function(json) {
alert("Updated Successfully via resize");
}
});
}


This returns a event.end is null error however



eventResize: function(event, delta) {
alert(event.title + " end is now " + event.end.format());
$.ajax({
url: 'schedule/update',
data: 'title='+ event.title+'&start='+ moment(event.start).format("YYYY-MM-DD HH:mm:ss") +'&end='+ moment(event.end).format("YYYY-MM-DD HH:mm:ss") +'&id='+ event.id ,
type: "POST",
success: function(json) {
alert("Updated Successfully via resize");
}
});

}


note the only difference is



alert(event.title + " end is now " + event.end.format());


works in a slightly bugged way, when you try to resize the event it first doesn't work and resets while your mouse is stuck as if you're holding the left mouse button down to resize it again, in the console it says event.end is null but when you then click to resize and get out of the left click mode the alert pops up and it successfully updates.


It's hard to understand what is going on here, but for some reason it can get the event.end datetime if you 'bug' up the resize somehow with the alert function.


Any ideas?





Aucun commentaire:

Enregistrer un commentaire