I was using while adding events to Fullcalendar by external drag and drop, item doesn't get id to modify the dropped element (title, id and date) and get the callback in the drop function of the fullcalendar
var url = "json-save-urlaub.php?event="+date.format()+"&allDay="+date.hasTime();
$.post(
url,
function(data){ //callback function retrieving the response sent by the controller/action
//event is the object that will actually be rendered to the calendar
var event = jQuery.parseJSON(data);
//actually rendering the new event to the calendar
$('#calendar').fullCalendar('renderEvent', event, true);
//$('#calendar').fullCalendar('refetchEvents');
$('#calendar').fullCalendar('unselect');
}
);
However now I have two entries when I drop the element on the fullcalendar since the callback gives me a new event object and the one dropped I can't remove since it has no id and I can't remove it manually neither can I use it for the URL call.
The line $(this).remove();
has no effect. Neither has $("#calendar").fullCalendar( 'removeEvents', copiedEventObject._id);
when copying the dropped element first. How can I just have one element when dropping it?