RonM
September 19, 2019, 12:51pm
#1
Hi, is there a way to add child tasks when adding a task?
I need to add 4 child tasks for every new task added. I want to have this happen all the time so the user does not have to add these tasks each time.
Also, is there a way to not show the new task “+” symbol on each row? I only want the “+” symbol at the top of the container.
Thanks in advance for any help!
Polina
September 20, 2019, 2:55pm
#2
Hello @RonM ,
You should use addTask
method to create these 4 children. Create a function that will do that and call it in the onAfterTaskAdd handler.
Related API
https://docs.dhtmlx.com/gantt/api__gantt_addtask.html
https://docs.dhtmlx.com/gantt/api__gantt_onaftertaskadd_event.html
Yes, “+” icons can be hidden by the next CSS rule:
.gantt_row_task .gantt_add{
visibility:hidden;
}
Demo that demonstrates how it works http://snippet.dhtmlx.com/59061d993
1 Like
RonM
September 23, 2019, 3:04pm
#3
Hi Polina,
Thanks again for your help!
I have an issue and hope there is a way to do it. So when I do the “add task” the parent and child tasks are not saved to the database until I edit each task. is there a way to bring up the lightbox when I click the addTask icon?
Thanks
RonM
September 24, 2019, 2:33pm
#4
I figured this out, I needed to use “createTask” not “addTask”
Thanks!
Polina
September 24, 2019, 3:10pm
#5
@RonM
Yes, you are right.
createTask opens the lightbox for new added events. Hope the issue is fully solved.
1 Like