Issue 2460: Error in external drop method for v2 or I'm missing something? Twice render of the items
Status:  Invalid
Owner: ----
Closed:  Mar 2015
Reported by mcvendr...@gmail.com, Mar 13, 2015
After learning these days about Fullcalendar, I followed an example of external-drop to do the same in my project, but it doesn't work the same.

It seems that external-drop example I used (from Stackoverflow) is v1.5.3 version of Fullcalendar, and I'm using the latest 2.3.1

The unique difference is that, when dropping an item in the example, if you don't explicit render the new item, it doesn't appear in the calendar, as seems to be logical. With version 2.3, if you execute the same example, it renders the item twice, that has no sense for me.

Maybe I'm missing something, but if you need to cancel the drop for some reason (in my case, because the item was not saved in the database because an error), you can't cancel the render.

The example code I used is:

    drop: function(date, allDay) { 
        // Retrieve the dropped element's stored Event Object 
        var originalEvent = $(this).data('event'); 
         
        var copiedEvent = $.extend({}, originalEvent); 
         
        // Assign it the date that was reported 
        copiedEvent.start = date; 
        copiedEvent.allDay = allDay; 
        $('#calendar').fullCalendar('renderEvent', copiedEvent); 
    } 

Mar 16, 2015
Project Member #1 adamrs...@gmail.com
when event data is associated with a draggable element, and the event is dropped, that is the scenario where the new event element is automatically created

http://fullcalendar.io/docs/dropping/eventReceive/

if you want the 1.x behavior, just make sure to NOT attach any event data to the element
Status: Invalid
Mar 17, 2015
#2 mcvendr...@gmail.com
Thank you Adam. So the behaviour changed from 1.x to 2.x

I've tested your tip and it works: if I don't set "event" in the droppable item, nothing happens automatically, so the solution for me was to use "myevent" in the data associated, instead the reserved word "event".

I like more the 1.x behaviour (has more logic to me), but I understand that people prefer "automagic" things happens.