Task Type For Created Task

Hi All,

Is it possible to add task type in the newly created object when I click plus sign?
See image


you can assign the initial values (and a type), in this event
docs.dhtmlx.com/gantt/api__gantt … event.html

That was a fast response. :slight_smile:
Ok, I’d use the parent property to get the task type.
How can I set it to the new task?


can you please clarify the question? You can simply assign the property to the task object available from the arguments

gantt.attachEvent("onTaskCreated", function(task){ var types = gantt.config.types; if(task.parent){ var parent = gantt.getTask(task.parent); if(parent.type == types.project) task.type = types.task; else task.type = types.project; }else{ task.type = types.project; } return true; });


This is ok.

You can also check the example in this article
docs.dhtmlx.com/gantt/api__gantt … level.html

I sent my last reply few weeks ago but logged as today :smiley: