> ## Documentation Index
> Fetch the complete documentation index at: https://learn.nextedy.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Configure Item Sorting

> This guide shows you how to control the sort order of work items in the Nextedy GANTT chart using widget parameters and configuration properties.

export const LastReviewed = ({date}) => {
  if (!date) return null;
  const formatted = new Date(`${date}T00:00:00Z`).toLocaleDateString("en-US", {
    year: "numeric",
    month: "long",
    day: "numeric",
    timeZone: "UTC"
  });
  return <p className="mt-10 text-sm text-gray-400 dark:text-zinc-500 not-prose">
      Last reviewed on {formatted}
    </p>;
};

## Set the Sort By Widget Parameter

The primary way to control sorting is through the **Sort By** widget parameter on the Gantt widget:

1. Open your Gantt page in **Edit** mode.
2. In the widget parameter sidebar, locate the **Sort By** field.
3. Enter the Polarion field ID you want to sort by (for example, `id`, `title`, `priority`, or a custom field ID).
4. Click **Apply** to save the change.

The default value for the Sort By parameter is `id`, which sorts work items by their Polarion work item ID.

## Configure the Default Sort Order

Administrators can set the system-wide default sort field using configuration properties. This default applies to all new Gantt widgets until overridden at the widget level.

### Work Items Gantt

Set the default sort field in **Administration > Configuration Properties**:

```
nextedy.gantt.workitems.default.sort_by=id
```

### Plans Gantt

For Plans Gantt widgets, the sort parameter also defaults to `id`:

```
nextedy.gantt.plans.default.sort_by=id
```

## Sort Children by ID

By default, child work items follow the sort order defined by the Sort By parameter. To force child items to always sort by their work item ID regardless of the parent-level sort, set the following configuration property:

```
nextedy.gantt.sort_children_by_id=true
```

The default value is `false`.

| Configuration Property                    | Purpose                                 | Default |
| ----------------------------------------- | --------------------------------------- | ------- |
| `nextedy.gantt.workitems.default.sort_by` | Default sort field for Work Items Gantt | `id`    |
| `nextedy.gantt.plans.default.sort_by`     | Default sort field for Plans Gantt      | `id`    |
| `nextedy.gantt.sort_children_by_id`       | Force child items to sort by ID         | `false` |

<Warning title="Manual drag-and-drop sorting is not supported">
  The Gantt chart does not support manual reordering of items by dragging rows. Sorting is always determined by the configured Sort By field. If you need different sort orders for different views, create separate Gantt pages with different Sort By values.
</Warning>

<Tip title="Multi-field sorting">
  You can sort by multiple fields by specifying them in the Sort By parameter. The primary sort field takes precedence, with secondary fields used to break ties.
</Tip>

<Warning title="PlannedIn sorting as a secondary field">
  Using the `plannedIn` field as a secondary sort criterion has known limitations. If you experience unexpected ordering when combining `plannedIn` with other sort fields, try using `plannedIn` as the primary sort instead.
</Warning>

## Verification

After changing the Sort By parameter, you should now see:

* Work items reordered according to the specified field value.
* Child items following the parent-level sort order (or sorted by ID if `nextedy.gantt.sort_children_by_id` is `true`).
* The sort order persisting across page reloads.

## See Also

* [Use Gantt Filters](/gantt/guides/filtering/gantt-filters)
* [Use Dynamic Queries with Page Parameters](/gantt/guides/filtering/dynamic-queries)
* [Configure Grid Columns](/gantt/guides/visualization/columns)
* [Configure Page Parameters](/gantt/guides/layout/page-parameters)

<LastReviewed date="2026-07-02" />
