Splitting and Merging tasks

10 Mar 20251 minute to read

Splitting task at load time

To split task at load time, we can define segment details in both hierarchical and self-referential way. Refer below link for more details.

Split task dynamically

The task can be split dynamically, either by using the context menu or dialog.

@Html.EJS().Gantt("Gantt").DataSource((IEnumerable<object>)ViewBag.DataSource).Height("450px").Toolbar(new List<string>() 
  { "Add", "Cancel", "CollapseAll", "Delete", "Edit", "ExpandAll", "Search", "Update" }).TaskFields(ts => ts.Id("TaskId").Name(
                "TaskName").StartDate("StartDate").EndDate("EndDate").Duration("Duration").Progress("Progress").Child("SubTasks").Segments("Segments")
                ).EnableContextMenu(true).EditSettings(es=>
                es.AllowEditing(true).AllowAdding(true).AllowDeleting(true).AllowTaskbarEditing(true)).Render()
public ActionResult SplitTasks()
        {
            ViewBag.DataSource = GanttData.SplitTasksData();
            return View();
        }

Alt text

Alt text

Alt text

Alt text

Merge tasks

The split tasks can be merged either by using the Merge Task item of the Context menu or by using the dialog. We can also merge the tasks, by simply dragging the segments together in the UI.

Limitations of Split tasks

  1. Parent and milestone tasks cannot be split into segments.
  2. The task must have a width greater than the timeline unit cell in order to be split.
  3. Split task is not supported with Multi taskbar.