changing a task's parent


I am testing the gantt component a bit and i’ve bumped into a problem.

I have 4 tasks, as shown below:

I would like to take task 3 and move it under task 2, so task 2 to becomes the parent of task 3.

i did this as following:

var task = gantt.getTask(gantt.getSelectedId());

//we loop all tasks that are on the same level as the one we selected
var tasks = gantt.getChildren(task.parent);

    var previousTaskId = undefined;
    $.each(tasks, function (index, item) {
        // we attach the previousId to the current element in the loop,
        // the moment we reach the item that matches the selected item, we break out of the loop
        // so we have the previous element in our variable
        if (item != {
            previousTaskId = item;
        } else {
            return false;

    if (previousTaskId != undefined) {
        // we change the parent of the selected task to match the above task
        gantt.getTask( = previousTaskId;

        // then we change the type of the new parent task to 'project' and save that to
        var previousTask = gantt.getTask(previousTaskId);
        previousTask.type = "project";


This leaves me with the following result:

As you can see, the grid is ok. The task gets added to the new parent just fine, the problem is with the gantt itself. The parentTasks is now coloured green, as it should be, but i can still resize is, and it also doesnt take the length of its children. Can someone help me tackle this problem?

probably the issue is fixed in the upcoming version. You may try the latest build from this post
I’ve tried to reproduce the problem on a basic example (/samples/01_initialization/01_basic_init.html) with following code:

gantt.getTask(3).parent = 2; gantt.getTask(2).type = "project"; gantt.updateTask(3); gantt.updateTask(2);
All seems correctly with the latest dev version. The release is planned for this September