问题
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
回答1:
$('#example').fullCalendar({
disableDragging: true
});
thanks to https://stackoverflow.com/a/7907576/216084
回答2:
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
回答3:
Edit fullcalendar.js
and change line 3547
from
var d2 = cellDate(cell);
to
var d2 = cellDate(origcell);
回答4:
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
回答5:
Quick look at the documentation looks like it's just an option to the constructor:
http://arshaw.com/fullcalendar/docs/event_ui/disableDragging/
回答6:
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.
来源:https://stackoverflow.com/questions/4903140/how-to-disable-the-drag-in-fullcalendar-but-keep-the-ability-to-click-on-a-time