Skip to main content

Prerequisites

  • A Gantt widget with parent-child task hierarchy configured via the Parent Role parameter
  • Edit mode access

Understand the dragChildren Widget Parameter

The dragChildren widget parameter controls whether dragging a parent task automatically moves all its child tasks by the same offset. When enabled, the entire subtree shifts together, preserving the relative schedule. When disabled, only the parent moves and children stay at their original dates.
ParameterTypeDefaultDescription
dragChildrenBooleantrueMove child tasks together with parent on drag

Enable or Disable Drag Children

  1. Open the Polarion page containing the Gantt widget
  2. Edit the widget properties
  3. Set the Drag Children parameter:
    • Yes (default) — children move with parent
    • No — only the parent task moves; children remain at their original dates

Toggle Drag Children at Runtime

You can also toggle this behavior during an active edit session using the toolbar:
  1. Enter Edit mode by clicking Edit in the toolbar
  2. Locate the Drag Children toggle button in the toolbar
  3. Click it to switch between moving children together or leaving them independent
This is useful when you need to move a parent to a new time slot without disrupting individually scheduled children. diagram

Range Conflict Detection

When you drag tasks independently (with dragChildren disabled), child tasks may end up outside their parent’s date range. The Gantt can detect and highlight these conflicts:
  • Conflicting tasks receive a visual warning style (highlighted border)
  • Both the parent and the out-of-range child are marked
  • Conflict highlighting clears automatically when the task is moved back within the parent’s range
  • Range conflict checks respect the working calendar when evaluating boundaries
Range conflict detection requires explicit enablement. The default configuration has rangeConflict.enabled = false. When enabled, you can further control detection with rangeConflict.checkStart and rangeConflict.checkEnd to check start date, end date, or both.

Automatic Conflict Resolution

When a child task is dragged outside its parent’s date range, the Gantt can automatically resolve the conflict by expanding the parent’s range to accommodate the child’s new position. This resolution works hierarchically — all ancestor tasks in the tree are adjusted, not just the immediate parent. The same resolution applies when a task is resized beyond its parent’s boundaries.
To prevent certain work items from being moved at all, use an Item Script to set task.readonly = true for specific work item types. For example, to lock user stories while allowing tasks to be dragged:
if (wi.getType().getId() === 'userstory') {
    task.readonly = true;
}
This approach lets you protect parent items from accidental rescheduling while keeping children editable.
The Gantt does not support drag-and-drop to move a task from one parent to another. To change a task’s parent, edit the parent link directly through the work item form in Polarion or use the lightbox.

Verify Your Configuration

  1. Enter Edit mode in the Gantt
  2. Drag a parent task bar to a new date
  3. If dragChildren is enabled, you should now see all child task bars shift by the same number of days
  4. If dragChildren is disabled, only the parent bar moves and children remain in place
  5. Toggle the Drag Children toolbar button and repeat the test to confirm the toggle works

See Also

Support TicketsSource Code
  • prod-gantt-src/com.nextedy.polarion.gantt/src/com/nextedy/polarion/gantt/widget/GanttWidgetConfig.java
  • prod-gantt-src/com.nextedy.polarion.gantt.client/cypress/e2e/range-conflict/afterDragConflict.cy.ts
  • prod-gantt-src/com.nextedy.polarion.gantt.client/src/js/commands.js
  • prod-gantt-src/com.nextedy.polarion.gantt.client/src/js/config.js
  • prod-gantt-src/com.nextedy.polarion.gantt.client/cypress/e2e/ganttPreventMovingOutOfParent.cy.ts