我正在使用eventSources在全日历中呈现事件。
eventSources = [ {events: Array1, editable: overlap: false }, {events: Array2, overlap: false}];
有时 Array1 和 Array2 有重叠的时间计划。但我想优先考虑阵列 1 事件。如果 Array1 中有事件在 Array2 中具有相同的开始时间或结束时间,我只想显示 Array1 事件。即使我使用"overlap:false"属性,事件也相互重叠。谁能帮我解决这个问题。有没有办法覆盖可用事件?
$('#external-events .fc-event').each(function() {
// store data so the calendar knows to render an event upon drop
$(this).data('event', {
title: $.trim($(this).text()),
backgroundColor:$.trim($(this).css("background-color")), // use the element's text as the event title
textColor:$.trim($(this).css("color")), // use the element's text as the event title
stick: true,// maintain when user navigates (see docs on the renderEvent method),
overlap:true,
durationEditable:true,
});
// 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
});
});
您必须添加重叠选项。它将限制事件重叠。