Hi,
I’m trying to Add a Task as a sibling of a selected task, but is not getting anywhere. I did try to move the new task on this event onAfterTaskAdd but it seems to call multiple times my api. one for update and one for order.
Anyone knows what the best practice on adding a task below a selected task?
function addSibling(id:any){
const selectedTask = gantt.getTask(id);
const newId = 0;
var index = selectedTask.$index;
gantt.createTask({id: newId, start_date:gantt.getState().min_date, duration: 1},selectedTask.parent, index);
If you have a different use case, it can be related to something else, but it is hard to suggest what might be wrong as I don’t see your code. In that case, please, reproduce the issue in the snippet, then click on the “Share” button and send me the link: https://snippet.dhtmlx.com/38ee1b370
Or send me a ready demo with all the necessary Javascript and CSS files so that I can reproduce the issue locally.
Get a guaranteed answer from DHTMLX technical support team
under the most suitable support plan