How do I disable drag and drop in fullcalendar

♀尐吖头ヾ 提交于 2019-11-29 02:52:19

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
});
Dilpreet singh

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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!