Skip to content

Impossible to drag events between resources in 2.1 #43

Description

@jsgoupil

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions