fullcalendar icon indicating copy to clipboard operation
fullcalendar copied to clipboard

Impossible to drag events between resources in 2.1

Open jsgoupil opened this issue 10 years ago • 2 comments

I found the problem but I didn't find the best way to fix this yet. Maybe you could have a look? And if you create a unit test with the commit, I would be able to see what has to be done to fix a bug :)

Repro:

resources:[{id:"1", name:"Bob"}, {id:"2", name: "Joe"}],
events: [
        {
          title: "Title 1",
          start: moment(),
          end: moment(moment() + 3600 * 2 * 1000),
          resources: ['1']
        },
]

The bug is in the following method: rangeToSegs: function(rangeStart, rangeEnd, resourceIds) { resourcesIds here is not what is being dragged but contains the original event. So the rangeToSegs basically will not display the drag properly, it will only display the resources where it is originating from.

If we compare to v2.0, you used to check the left position of the mouse event to calculate the delta column. You could do something similar in 2.1, but going up the stack, I can't find any ui event information. The only information I find is here: cellOver: function(cell, date) { which contains the column number. That would be where we would get the info. But that's super far in the stack. So maybe the only way I see is to re-implement segDragMousedown ?

Also, just to keep in mind, I think you would like to keep the functionality of dragging an event present in 2+ resources, they all should move along.

jsgoupil avatar Oct 21 '14 01:10 jsgoupil

There is a problem with the same method if you set selectable: true The JavaScript will crash.

jsgoupil avatar Oct 21 '14 01:10 jsgoupil

yeah it would be great if you will fix it, I prepared whole app but I need this events...

pawelas avatar Oct 30 '14 13:10 pawelas