I am trying on this demo in jsbin to have some events with scheduler and restrict to move some of them to specific resources.
$('#calendar').fullCalendar({
schedulerLicenseKey: "CC-Attribution-NonCommercial-NoDerivatives",
// put your options and callbacks here
header: {
left: 'prev,next today',
center: 'title',
right: 'month,basicWeek,agendaDay'
},
defaultView: 'agendaDay',
defaultDate: '2017-05-09',
navLinks: true, // can click day/week names to navigate views
editable: true,
nowIndicator: true,
allDaySlot: false,
fixedWeekCount: false,
eventLimit: true, // allow "more" link when too many events
slotLabelFormat: "HH:mm",
slotLabelInterval: "00:60:00",
events: [
{
title: 'Long Event',
start: '2017-05-09T16:00:00',
end: '2017-05-09T17:00:00',
resourceId: 'b',
constraint: {
resourceIds: ['c', 'd']
}
},
{
id: 999,
title: 'Test Event',
start: '2017-05-09T16:00:00',
end: '2017-05-09T18:00:00',
resourceId: 'a',
constraint: {
resourceIds: ['b', 'c', 'd']
}
}
],
resources: [
{id: 'a', title: 'Auditorium A'},
{id: 'b', title: 'Auditorium B'},
{id: 'c', title: 'Auditorium C'},
{id: 'd', title: 'Auditorium D'}
]
})
Now If you follow the instructions here you will notice that inside the resourcesIds you specify the ids that you want the event NOT to go. But in the jsbin you can see that the reverse is happening.
Also if you switch on the month or week view you cannot drag and drop from one day to the other. Is restricting you due to the eventConstraint.
I am doing something wrong or is this something faulty?
Got around the problem with this solution for the moment but i think that the above is a bug. You can try my solution here.
What i did is to pass the constraints in a custom field on the event and to check on the drop if its correct.
Now If you follow the instructions here you will notice that inside the resourcesIds you specify the ids that you want the event NOT to go.
No, the article says precisely the opposite of that:
Additional properties can be applied to force an event to stay within specific resources
(I added the bold.)
This means you give a list of the resources that the event can be dragged to. It cannot therefore be dragged to any resources not named within the constraint property.
As per the example given in the link you posted:
constraint: {
resourceIds: [ 'a', 'b', 'c' ] // constrain dragging to these
}
The event with this property will only be allowed to be dragged onto resources 'a', 'b', and 'c'.
I think you have mis-understood the documentation.