say
say

Reputation: 2655

How to disable the drag in FullCalendar but keep the ability to click on a time slot and have the "placeholder" appointment still render

How do I disable the draggable feature in the below FullCalendar example? While I do not want the "draggable" functionality, I still want the ability to click on a time slot and have the place holder appointment still render as normal.

http://arshaw.com/js/fullcalendar/demos/selectable.html

Upvotes: 2

Views: 11172

Answers (6)

Newman
Newman

Reputation: 79

it's not necessary to edit fullcalendar script you can do that like this:

selectAllow: function (e) {
    if (e.end.diff(e.start, 'minutes') > 15) {
        return false;
    }
}

It's for {slotDuration: 15} (minutes in my case), suitable for Scheduler plugin v.3

Upvotes: 1

anonymous
anonymous

Reputation: 19

Edit fullcalendar.js and change line 3547 from

var d2 = cellDate(cell);

to

var d2 = cellDate(origcell);

Upvotes: 1

user216084
user216084

Reputation:

$('#example').fullCalendar({
    disableDragging: true
});

thanks to https://stackoverflow.com/a/7907576/216084

Upvotes: 4

Thymotep
Thymotep

Reputation: 1

To remove the ability to select multiple days, I modified the file fullcalendar.js (v1.5.3) at line 5019:

Replace this :

trigger('select', null, startDate, endDate, allDay, ev);

By this :

trigger('select', null, startDate, startDate, allDay, ev);

Works well for me.

Upvotes: 0

arshaw
arshaw

Reputation: 2725

currently not possible to limit the selection to a single slot but here is the issue for it: http://code.google.com/p/fullcalendar/issues/detail?id=786

Upvotes: 1

lsuarez
lsuarez

Reputation: 4992

Quick look at the documentation looks like it's just an option to the constructor:

http://arshaw.com/fullcalendar/docs/event_ui/disableDragging/

Upvotes: 0

Related Questions