This is a multi-part problem. Here's the basic idea.
Something like this JSFiddle.
selectable: true,
select: function (start, end, jsEvent, view) {
$("#calendar").fullCalendar('addEventSource', [{
start: start,
end: end,
rendering: 'background',
block: true,
}, ]);
$("#calendar").fullCalendar("unselect");
},
selectOverlap: function(event) {
return ! event.block;
}
Background events are optional, but this is usually desired (visually).
If dragging and dropping already created events is desired, you can use the selectOverlap
function in eventOverlap
as well.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…