Hi @jinhua,
If I understand you correctly you want to add tasks, not to the end of the list but the specific position, in order to do this you should add index attribute, which will specify chart position of the task to the addTask/createTask
methods:
gantt.addTask(backupTask,task.parent,1);
You can see how it could be implemented in the following snippets:
gantt.addTask: http://snippet.dhtmlx.com/bdf5f87d6
gantt.createTask: http://snippet.dhtmlx.com/1f9694a87
API:
addTask:
https://docs.dhtmlx.com/gantt/api__gantt_addtask.html
createTask:
https://docs.dhtmlx.com/gantt/api__gantt_createtask.html
If you asked how to customize add-icons, you could do this by changing their CSS classes
.gantt_grid_head_add
for the title link and
.gantt_add
for column references. I made a little example on how to change the default link-image using the background-image
rule in this snippet (HTML tab):
http://snippet.dhtmlx.com/e259854f0.
Important: since these styles are defined in our dhtmlxgantt.css
template file, it is sometimes necessary to use ! Important
to change some rules.
If I misunderstood you, could you please, clarify your question?