34

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.

NullUserException
  • 83,810
  • 28
  • 209
  • 234
Arial
  • 341
  • 1
  • 3
  • 3

13 Answers13

41

I know this is an old question, but nobody has answered this correctly, so here you go...

$('#example').fullCalendar({
    disableDragging: true
});
Scott Greenfield
  • 2,788
  • 2
  • 22
  • 21
  • 5
    If you want to disable resizing as well as dragging, then you can set `editable : false` – jasop Aug 27 '13 at 04:57
23

DisableDragging is replaced by: eventStartEditable (since version 1.6.3)

sideshowbarker
  • 81,827
  • 26
  • 193
  • 197
JochemQuery
  • 1,495
  • 2
  • 26
  • 38
  • I wanted to ask if there is a way to prevent selection dragging in month view-in other words the user must able to select only one monthday – Dimitris Papageorgiou Sep 24 '14 at 09:08
  • @DimitrisPapageorgiou sorry, I don't know that. I've done 99% of my work with day and week view. – JochemQuery Sep 24 '14 at 12:48
  • I am just building an appointments web app and I want just to give my users the option of booking an appointments also from monthview...by selecting only one day(as an appointment by definition cannot span more than 1 day)...anyway,thanks for your answer. – Dimitris Papageorgiou Sep 24 '14 at 17:54
  • 3
    This is the correct answer as for 2017. More info: https://fullcalendar.io/docs1/event_ui/eventStartEditable/ – Miquel Canal Apr 10 '17 at 09:30
18

Check the code below:

set editable false will disable dragging.

$('#calendar').fullCalendar({

editable: false,

});
Ronak Chaniyara
  • 5,335
  • 3
  • 24
  • 51
Dilpreet singh
  • 181
  • 1
  • 3
12

You just need to set the disableDragging option to true when initializing your calendar.

$('#calendar').fullCalendar({
    disableDragging = true
});
theycallmemorty
  • 12,515
  • 14
  • 51
  • 71
7

Not worked for me: disableDragging: true

The bellow code worked for me so please try:

$('#example').fullCalendar({
    eventStartEditable: false
});

The above code stops dragging of any event date to another date

4

place eventStartEditable: false as shown here:

initialView: 'resourceTimeline',
slotMinWidth:1,
eventDurationEditable: false, // Disable Resize
// disableResizing:false  Currently Not Working

eventStartEditable: false, // disable dreage drop
// disableDragging:false  Currently Not Working
eventTimeFormat: {
  hour: '2-digit',
  minute: '2-digit',
  hour12: true
},

Its Working

for More https://fullcalendar.io/docs/v1/disableResizing https://fullcalendar.io/docs/v1/disableDragging

userSLK
  • 91
  • 5
3

It's late but as per the new update in FULL CALENDAR

The disableDragging is depricated from fullcalendar now.

Here is the list of all Deprecated functions in full calander

So to disable the drag you need to add editable: false in the place where you create the event object.

Something like below.

this.events.push({
    id: meeting.id,
    title: "meeting 1",
    start: meetingStartDate,
    editable: false
});
always-a-learner
  • 3,671
  • 10
  • 41
  • 81
2
$('#calendar').fullCalendar({
    editable: false
});
2

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.

LakiGeri
  • 2,046
  • 6
  • 30
  • 56
2

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

user1477388
  • 20,790
  • 32
  • 144
  • 264
2

For version 5.5.1 you want to use editable property and set it to false. That will make sure events can not be resized or dragged.

A Paul
  • 8,113
  • 3
  • 31
  • 61
0

it depends on version :

$('#calendar').fullCalendar({
  ...
 disableDragging: true,
 editable: false,
 eventStartEditable: false,
  ...
});
0

FullCalendar - Version 6, 2023 (editable: true/false) "Determines whether the events on the calendar can be modified." https://fullcalendar.io/docs/editable

let calendar = new Calendar(calendarEl, {
  plugins: [ interactionPlugin ],
  editable: true
})

------- Global Bundle: -------

var calendar = new FullCalendar.Calendar(calendarEl, {
  // no plugin configuration required!
  editable: true,
})
TV-C-1-5
  • 680
  • 2
  • 13
  • 19