| Issue 2460: | Error in external drop method for v2 or I'm missing something? Twice render of the items |
‹ Prev
240 of 240
|
| 1 person starred this issue and may be notified of changes. | Back to list |
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
Status:
Invalid
Mar 17, 2015
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. |
|
| ► Sign in to add a comment |