这可能会帮助您:
拖放的工作版本 : http://jsfiddle.net/wkKfB/15/ http://jsfiddle.net/wkKfB/15/
Dragobj = false 的解决方案是您需要将可放置事件绑定到日历,以便可拖动的知道 DOM 对象是什么可丢弃的请参阅此处的工作示例:http://jsfiddle.net/CZQkm/3/ http://jsfiddle.net/CZQkm/3/&&http://jsfiddle.net/DEsdN/12/ http://jsfiddle.net/DEsdN/12/
*直到这里
(您的版本,但进行了一些调整。顺便说一句,我在这里 jsfiddl-ed 你的问题:http://jsfiddle.net/wkKfB/16/ http://jsfiddle.net/wkKfB/16/) (问题是绑定外部事件)
好的文档位于此处:http://arshaw.com/fullcalendar/docs/dropping/droppable/ http://arshaw.com/fullcalendar/docs/dropping/droppable/
问题是您需要从外部添加这些拖动事件。
您可以更改 css 并使其适合您的使用。
Quote *[来自上面有关外部拖放的文档。]* http://arshaw.com/fullcalendar/docs/dropping/droppable/ http://arshaw.com/fullcalendar/docs/dropping/droppable/
> How can I use this to add events???
>
> Good question. It is a common need to have an "external list of events" that can be dragged onto the calendar.
>
> While the droppable option deals with generic jQuery UI draggables and is not specifically tailored to adding events, it is possible to
> achieve this with a few lines of code. Follow the
> external-dragging.html example in FullCalendar's download. You can
> also view the example online.
>
> In short, you must call renderEvent yourself in the drop callback.
另一个链接:http://arshaw.com/js/fullcalendar-1.5.3/demos/external-dragging.html http://arshaw.com/js/fullcalendar-1.5.3/demos/external-dragging.html
要捕获外部事件,您需要添加此代码,但上面的示例已为您完成所有设置,并且应该很清楚
/* initialize the external events
-----------------------------------------------------------------*/
$('#external-events div.external-event').each(function() {
// create an Event Object (http://arshaw.com/fullcalendar/docs/event_data/Event_Object/)
// it doesn't need to have a start or end
var eventObject = {
title: $.trim($(this).text()) // use the element's text as the event title
};
// store the Event Object in the DOM element so we can get to it later
$(this).data('eventObject', eventObject);
// make the event draggable using jQuery UI
$(this).draggable({
zIndex: 999,
revert: true, // will cause the event to go back to its
revertDuration: 0 // original position after the drag
});
});
/* initialize the calendar
-----------------------------------------------------------------*/