Gantt Task Type

Hello,
Its is possible to define type of task when i insert?
example: I need to define if i create a task in root (first button add in head) the type of task is a project. In the other situations the type is task.

Thank you.

Hello,
You can use the onBeforeTaskAdd event handler and change the task type when it appears on the root level:

gantt.attachEvent("onBeforeTaskAdd", function(id,task){
    if (task.$level == 0) task.type = 'project';
    return true;
});

Here is an example of how it works:
http://snippet.dhtmlx.com/d2f63643b

1 Like

Its done.
Thank you ramil :slight_smile: