Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Impossible to drag events between resources in 2.1 #43

Open
jsgoupil opened this issue Oct 21, 2014 · 2 comments
Open

Impossible to drag events between resources in 2.1 #43

jsgoupil opened this issue Oct 21, 2014 · 2 comments

Comments

@jsgoupil
Copy link

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
Copy link
Author

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

@pawelas
Copy link

pawelas commented Oct 30, 2014

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants