我正在使用支持资源的FullCalendar jQuery plugin
版本。在删除外部事件时在FullCalendar上获取资源ID
我按照this example拖动外部事件。
这一切工作得很好,但我找不到方法来获取与外部事件已被删除的单元格(日)关联的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();
}
}
我非常感谢您对此问题的任何帮助。
你是什么意思的'资源ID'?您是否在寻找事件发生地点的日期/时间? – ganeshk 2012-08-15 13:09:29
它看起来像'eventDrop'方法中的资源对象是可用的,但我认为您需要自定义该插件以使其在'drop'中可用。 – cOle2 2012-08-15 20:13:54
谢谢Ganesh。 它是一个FullCalendar版本,允许资源列在左侧 - 请参阅http://tux.fi/~jarnok/fullcalendar-resourceviews/ 每个资源都有一个ID和一个名称。 其他所有工作都正常,但当外部事件发生时,我无法获得相关资源的ID。 再次感谢。 – Nick 2012-08-15 20:59:19