Open jmarquesh opened 11 years ago
@jmarquesh Did you find the solution for it?
I may have a solution. I will have to check tonight.
Search for this:
eventElement.draggable({
Inside that object search for this line:
stop: function(ev, ui) {
Inside that function search for this:
// resource changed?
Below that comment modify the existent code to match this:
var oldResourceId;
if (event.resource) {
oldResourceId = event.resource.id;
var newColumn = event.resource._col + columnDelta;
var resources = calendar.getResources();
event.resource = resources[newColumn];
event.resource._col = newColumn;
}
eventDrop(this, event, dayDelta, minuteDelta, allDay, ev, ui, oldResourceId);
Search for the function eventDrop, add the oldResourceId parameter:
function eventDrop(e, event, dayDelta, minuteDelta, allDay, ev, ui, oldResourceId)
In the same function call moveEvents sending the oldResourceId:
moveEvents(eventsByID[eventId], -dayDelta, -minuteDelta, oldAllDay, oldResourceId);
Add the oldResourceId parameter to moveEvents:
function moveEvents(events, dayDelta, minuteDelta, allDay, oldResourceId)
Add these lines before the call to normalizeEvents:
if (oldResourceId !== undefined)
e.resourceId = oldResourceId;
normalizeEvent(e, options);
Write again if you have questions.
Hey i ve tried your code, but it didnt work. May be we have different versions. I ve tried this calendar and followed these steps but no luck http://www.ikelin.com/fullcalendar-resource-day-view-bug/
When dropping an event in a new resource, if you call revertFunc to revert the changes, it will revert only the date and time, not the resource.