DHTMLX Docs & Samples Explorer

setPredecessor(pId)

  • pId - {int|string} id of predecessor task. Predecessor and this task will be joined by dependency line in the Gantt Chart.

creates a connection line between this task and predecessor with specified Id. Set it to empty string ”” to remove the connection.

    var task121 = project2.getTaskById(121);
    task121.setPredecessor(120);
 
    // to remove the connection
    var task122 = project2.getTaskById(122);
    task122.setPredecessor("");