angular-gantt icon indicating copy to clipboard operation
angular-gantt copied to clipboard

Tasks are not moving after gantt is loaded

Open JureFadiga opened this issue 8 years ago • 8 comments

When you try to move the task it does not react on mouse click in gantt tree. It only works after the gantt tree is completely minimized and then resized to normal. This happens in angular gantt version 1.2.13. Any previous version works fine.

JureFadiga avatar Jun 09 '16 07:06 JureFadiga

I confirm same problem. Task (mouse drag) move works on 1.2.12, but after upgrade to 1.2.13 it does not work.

hkusulja avatar Jun 09 '16 07:06 hkusulja

Interesting... I still have version 1.2.8 which has worked well for our needs, but I recently started seeing this behavior/problem after upgrading to Angular 1.5.9. Minimizing the gantt tree appears to restore the capabilities. Any idea what is behind this or how to fix besides asking users to minimize tree and reopen?

It looks like upgrading to 1.2.13 restores the functionality following initial load (without the minimization need) with Angular 1.5.9.

skidvd avatar Aug 08 '16 20:08 skidvd

Angular 1.5.6 Angular-gantt 1.2.14

Also experiencing this issue. In short, I load the data first time, I am able to move nothing. I load more data and I am able to move tasks. I did some digging and found out at least this:

In file: angular-gantt/src/plugins/movable.js

var onPressEvents = function(evt) {}; 

This function is never called after only the first load of the tasks. Additionally these elements appear to be undefined (or rather are empty JQlite objects) on the first load:

var foregroundElement = taskScope.task.getForegroundElement();

// IE<11 doesn't support `pointer-events: none`
// So task content element must be added to support moving properly.
var contentElement = taskScope.task.getContentElement();

Any ideas?

xeii avatar Oct 07 '16 08:10 xeii

Same problem. I've noticed that when the tasks are first loaded their directives weren't transformed to yet, and once taskScope.task.getContentElement() try to get the element by the class this.$element[0].querySelector('.gantt-task-content') this object is returning null.

I just don't know how to solve that. Any light @Toilal ?

andrepaulo avatar Jan 19 '17 15:01 andrepaulo

No sorry :(. Reproducing the issue on plunkr or a minimal github project would help.

Toilal avatar Feb 04 '17 15:02 Toilal

Same problem here also. As @andrepaulo mentioned it seems to be originating from this.$element[0].querySelector('.gantt-task-content') returning null. This is because upon evaluating getForegroundElement() and getContentElement() the task template hasn't fully rendered yet, looking something like this:

<div class="gantt-task" ng-class="task.model.classes">
   <gantt-task-background></gantt-task-background>
   <gantt-task-foreground></gantt-task-foreground>
   <gantt-task-content></gantt-task-content>
</div>

So trying to find the element with the associated classes using the querySelector fails. Not sure how to rectify this though...

garyforsterio avatar Feb 13 '17 15:02 garyforsterio

These changes fix the behavior: https://github.com/animustech/angular-gantt/commit/48108cec28174000a32a74aff85cde476c1fbd39#diff-54c74346f92ae0133fd289da2c74da12

Any change to get them merged? Would a PR be appreciated?

markuspalme avatar Aug 08 '17 09:08 markuspalme

I am facing the same issue ? any update on solving this issue?

peramsivateja avatar Sep 12 '17 11:09 peramsivateja