我正在使用FullCalendar jQuery plugin
支持资源的版本。
按照这个例子,我正在拖入外部事件。
这一切都很好,但我找不到一种方法来获取Resource ID
与外部事件已被丢弃的单元格(天)相关联的那个。
我正在使用下面的拖放功能。
drop: function(date, allDay) {
// this function is called when something is dropped
// retrieve the dropped element's stored Event Object
var originalEventObject = $(this).data('eventObject');
// we need to copy it, so that multiple events
// don't have a reference to the same object
var copiedEventObject = $.extend({}, originalEventObject);
// assign it the date that was reported
copiedEventObject.start = date;
copiedEventObject.allDay = allDay;
// render the event on the calendar
// the last `true` argument determines if the event "sticks"
// (http://arshaw.com/fullcalendar/docs/event_rendering/renderEvent/)
$('#calendar').fullCalendar('renderEvent', copiedEventObject, true);
// is the "remove after drop" checkbox checked?
if ($('#drop-remove').is(':checked')) {
// if so, remove the element from the "Draggable Events" list
$(this).remove();
}
}
我将非常感谢您对此提供任何帮助。