gantt.setParent fails when setting parent to root_id


#1

Using gantt.setParent() always throws an error when attempting to move a nested task to the root. For example:

gantt.setParent(anyNestedTaskId, gantt.config.root_id);

I found that gantt.moveTask(anyNestedTaskId, 0, gantt.config.root_id); works as expected as a workaround, but if this is the intended behavior the documentation doesn’t make that clear.

Here’s a minimal example to reproduce:
https://snippet.dhtmlx.com/or77o105


#2

Hello Brian,
Thank you for letting us know about that issue. I checked that it is reproduced even in the old versions. I added it as a bug to our internal tracker. The dev team will fix it in the future, but I cannot give you any ETA.


#3

Hello Brian,
Looks like the issue was with the wrong information in the documentation. It will be fixed in the future.
Gantt expects the task object, not its ID. To see the changes, you will need to use the render method.
Here is the updated snippet:
https://snippet.dhtmlx.com/syow8mpf