robicch / jQueryGantt

jQuery Gantt editor

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Problems with un indent to first level

stegas-vipcon opened this issue Β· comments

Hey Gantt-Team,

its me (again πŸ™ˆ).

I found some strange behaviour inside your demo. If I try to un indent an task this seems not to be possible if the task is on the second level. You can easily see this behaviour inside your demo if you try to un-intend the second task up to the very first level...

image
(In this example (image above) I am not able to move task coding one level up)

Is this a bug or a designed feature? If second: is it possible to configure it?

Thank you in advance for any helps. :)

It is a feature.
This editor has been built you to edit one project (root) at time -> only one task at first level

Enforced in the GUI, but not if loading the project from JSON?

@brentfraser yep, thats also what I noticed. I was able to load more than one task at root level.

@robicch

Okay, Thanks for that information.
So in the meanwhile I have found out the corresponding line to change. It was inside the outdent function of a Task (gantTask.js).

The if condition has to be < 1 instead of <= 1 in order to make it work for me (just in case someone else needs this too.)

  //a level must be >1 -> cannot escape from root
  if (this.level < 1)
    return false;

So I guess this is also the reason why move down is not working on the first level. The code that has to be changed in order to make this work can be found inside the moveDown function of the Task Class (ganttTask.js)

  var row = this.getRow();
  if (row >= this.master.tasks.length - 1 || row == 0)
    return false;

here the 2nd condition (row == 0) needs just to be removed.

I'm interested in mutiple roots as well. Using the source code from 3rd of July 2020 changing the functions in gantTask.js does not change the behaveiour for me. :(