2

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

say
  • 2,585
  • 7
  • 35
  • 48

6 Answers6

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

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

Community
  • 1
  • 1
1

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

arshaw
  • 2,750
  • 22
  • 32
  • 1
    Thanks for the response, arshaw. I am getting the desired behavior with a hack. I assign a hight to the placeholder appointment and only display the start time in the appointment head. Technically, if you click and drag it's selecting more but you can't see it because of the limited height. I only care about the start time in the backend anyway. Great plugin, BTW. – say Feb 15 '11 at 04:05
  • @arshaw has any being made so that when selecting month days only one is selected-and not many by dragging? Currently the API does not offer any such customization.The link you provide just describes the problem – Dimitris Papageorgiou Sep 24 '14 at 09:27
1

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

Newman
  • 81
  • 6
1

Edit fullcalendar.js and change line 3547 from

var d2 = cellDate(cell);

to

var d2 = cellDate(origcell);
Echilon
  • 10,064
  • 33
  • 131
  • 217
anonymous
  • 19
  • 2
0

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.

Sergey K.
  • 24,894
  • 13
  • 106
  • 174
Thymotep
  • 1
  • 2
0

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

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

lsuarez
  • 4,952
  • 1
  • 29
  • 51
  • That option is to disable the dragging of an event that is already rendered. I'm looking to disable the dragging when I create a new event on the calendar. – say Feb 05 '11 at 22:23
  • @sevens: No, it's part of a configuration object to the constructor called "editable" that lets you define in what ways the calendar can be manipulated. Define editable as follows: editable: { disableDragging: true }. Check out **[this fiddle](http://jsfiddle.net/lthibodeaux/LNu4d/)** for an example. – lsuarez Feb 05 '11 at 22:55
  • thanks for taking the time to respond and create a jsfiddle example. Unfortunately it's still not what I am looking for. In the fiddle example I am still able to click and drag to create (fullcal draws a placeholder for the event) a new event. I want to disable that functionality - I only want the user to be able to click a time (and not drag). In other words, the user should only be able to select a start time for the event and not select the whole duration of it. – say Feb 06 '11 at 07:35
  • 1
    @sevens Ah, misunderstood the initial post where you said "have the place holder appointment still render as normal." – lsuarez Feb 06 '11 at 07:45
  • no worries, I probably could have worded it differently. What I meant by that statment was I still want FullCal to render the "placeholder event" when a user clicks on a time block. I just don't want it to "extend" if a user drags. Thanks again for taking the time to answer. – say Feb 06 '11 at 08:01
  • @sevens have you find a solution to your problem...I am facing a similar issue – Dimitris Papageorgiou Sep 24 '14 at 09:30