Skip to main content

How the Constraint Works

When enabled, the Gantt chart enforces that every child task must stay within the date boundaries of its parent task. This applies to three editing interactions:
  • Drag — moving a child task bar left or right on the chart
  • Resize — extending or shrinking a child task bar from either end
  • Lightbox editing — changing dates or duration in the lightbox
If a child task is dragged or resized beyond the parent’s boundaries, the Gantt blocks the operation. When editing via the lightbox, validation prevents saving dates that fall outside the parent range.

Step 1: Enable Range Conflict Detection

Add the following to Widget Properties > Advanced > Gantt Config Script to enable conflict detection:
gantt.config.rangeConflict = {
  enabled: true,
  checkStart: true,
  checkEnd: true,
  highlightChild: true
};
PropertyDescription
enabledActivates parent-child date range conflict detection
checkStartValidates that child start dates are not before the parent start
checkEndValidates that child end dates are not after the parent end
highlightChildHighlights out-of-range child tasks with a visual warning style
If you only need to enforce that children do not extend past the parent’s end date (but allow earlier starts), set checkStart: false and checkEnd: true.

Step 2: Understand the Conflict Behavior

When range conflict detection is active, the Gantt provides several automatic behaviors: During drag operations:
  • Child tasks that are dragged outside the parent range are visually highlighted with a conflict indicator
  • When you move the child back within range, the conflict indicator is removed automatically
  • Parent tasks that have out-of-range children are also highlighted
During lightbox editing:
  • If you set a duration or date that places the task outside its parent’s bounds, an error message appears and the save button is disabled
  • The error message identifies the parent’s date range so you can correct the values
Parent resize behavior:
  • When a parent task is resized and its boundary moves inward, children that would fall outside the new range are automatically adjusted to stay within bounds
Range conflict checking operates across all ancestor levels, not just the immediate parent. A deeply nested task is validated against every ancestor in the hierarchy. If a grandchild task extends beyond a grandparent’s range, both the parent and grandparent are flagged.

Step 3: Resolve Existing Conflicts

After enabling range conflict detection, the Gantt scans all tasks on load. Parent tasks with out-of-range children are highlighted immediately, so you can identify and fix scheduling inconsistencies in your existing data. The conflict tooltip on affected parent tasks displays a message indicating that children have a range conflict.
If a task needs to move freely outside its current parent’s range, you can change the parent field to “no parent” in the lightbox. This removes the containment constraint for that task.

Step 4: Combine with Drag Children Toggle

The Gantt toolbar includes a toggle for dragging children together with their parent. When this toggle is active and you move a parent task, all children move with it, maintaining their relative positions and avoiding range conflicts. Use this in combination with range conflict detection to ensure hierarchical consistency during bulk rescheduling.

Verification

You should now see:
  • Child tasks blocked from being dragged past their parent’s start or end date
  • A visual highlight on parent and child tasks when a range conflict exists
  • Error messages in the lightbox when attempting to save dates outside the parent range
  • Conflicts detected automatically when the Gantt chart loads

See Also

KB ArticlesSupport TicketsSource Code
  • prod-gantt-src/com.nextedy.polarion.gantt.client/src/js/config.js
  • prod-gantt-src/com.nextedy.polarion.gantt.client/src/js/dateConflictDetector.js
  • prod-gantt-src/com.nextedy.polarion.gantt.client/cypress/e2e/ganttPreventMovingOutOfParent.cy.ts
  • prod-gantt-src/com.nextedy.polarion.gantt.client/src/types/dateConflictDetector.d.ts
  • prod-gantt-src/com.nextedy.polarion.gantt.client/src/types/gantt-extended.d.ts