Setting new parent for a task does not update child $level

If you change the parent of a task directly or with gantt.setParent(), then call gantt.taskUpdate() on it, the task’s children have the same $level. I believe this is a bug, since I get it even when using parent selector example (samples/05_lightbox/08_parent_selector.html). To reproduce it there, create a task that is a few levels down. That is, make a new task, then a task under it, then a task under it. Change the parent of the second-last task made to be no parent or Project #1, and notice that the child of the changed task is indented too much.

Is there a way around this other than recursively setting the $level attribute for subtasks and then updating all of them?

I am experiencing (what I think is…) the same issue.

I’ve illustrated the issue in a jsfiddle here: jsfiddle.net/jtdw73da/4/

Open the jsfiddle and click the “Move Task” button. Note that after Task 2 and Task 2.1 are moved, they have the same indentation level even though there is a parent -> child relationship.

Am I missing a step here to refresh the indentation? Or is this a bug?

@OP: does this illustrate the same problem you’re seeing?

Hi,
you can use gantt.moveTask method for displaying correct indentation level.

Link:
http://docs.dhtmlx.com/gantt/api__gantt_movetask.html
Example:
http://jsfiddle.net/jtdw73da/10/