I am using FullCalendar throughout my project and i need to display it in one area of my site where events are not draggable but to remain highlighted in the month view. Any ideas please.
I know this is an old question, but nobody has answered this correctly, so here you go...
$('#example').fullCalendar({
disableDragging: true
});
DisableDragging is replaced by: eventStartEditable (since version 1.6.3)
http://arshaw.com/fullcalendar/docs/removed/disableDragging/
You just need to set the disableDragging option to true when initializing your calendar.
$('#calendar').fullCalendar({
disableDragging = true
});
Check the code below:
set editable false will disable dragging.
$('#calendar').fullCalendar({
editable: false,
});
$('#calendar').fullCalendar({
editable: false
});
In v2 & v3 there is a new expression for this: eventStartEditable what should be set to false
, for disabling drag.
Furthermore if you want to disable the "drop" (e.g.: from other div) you should set droppable to false
as well.
To disable event drag/drop conditionally (on a per-event basis) you can use the eventAllow
option when initializing the fullcalendar object.
eventAllow: function(dropLocation, draggedEvent) {
if (draggedEvent.id === '999') {
return dropLocation.start.isAfter('2016-01-01'); // a boolean
}
else {
return true; // or return false to disallow
}
}
Reference: https://fullcalendar.io/docs/eventAllow
来源:https://stackoverflow.com/questions/3514689/how-do-i-disable-drag-and-drop-in-fullcalendar