Skip to main content

Set Initial Sort Order

Define the default sort order when users first open your RISKSHEET by configuring the sortBy property:
{
  "sortBy": ["priority", "~dueDate"],
  "columns": [
    {
      "id": "priority",
      "header": "Priority",
      "type": "enum:priority",
      "bindings": "priority"
    },
    {
      "id": "dueDate",
      "header": "Due Date",
      "type": "date",
      "bindings": "dueDate"
    }
  ]
}
The ~ prefix indicates descending sort order. Without the prefix, columns sort ascending by default.
Use column IDs (not header names) in the sortBy array. The order of IDs determines sort priority.

Enable User Sorting

Users can click column headers to sort interactively:
  • Single click: Sort ascending
  • Second click: Sort descending
  • Third click: Remove sort
  • Ctrl/Cmd + Click: Add to multi-column sort without clearing existing criteria
Merged column headers (using columnSpan > 1) do not support click-to-sort. Users must click individual sub-column headers within the merged range.

Understanding Column Type Sorting

RISKSHEET applies specialized sorting logic based on column type:
Column TypeSorting Behavior
Work Item ID (id binding)Alphanumeric sort: PROJECT-2 before PROJECT-10
Outline Number (outlineNumber binding)Hierarchical sort: 1.2 before 1.10
Item Link (itemLink)Sorts by linked item’s ID
Multi-Item Link (multiItemLink)Sorts by concatenated labels of all linked items
Nested Columns (sub-columns)Sorts by the nested property value from linked items
Work Item ID Sorting:
  RISK-1, RISK-2, RISK-10, RISK-20  ✓ Correct
  (not RISK-1, RISK-10, RISK-2, RISK-20)

Outline Number Sorting:
  1.1, 1.2, 1.10, 1.20  ✓ Correct
  (not 1.1, 1.10, 1.2, 1.20)

Comparison Mode Sorting Restrictions

When comparing baselines or revisions, RISKSHEET enforces mandatory sorting:
  • Sorting by Item ID and Revision is mandatory and cannot be removed
  • Downstream/task columns cannot be sorted in comparison mode
  • The system automatically removes invalid sort criteria when entering comparison mode

Filterable Columns and Sorting

Enable the filterable property to allow both filtering and sorting on a column:
{
  "id": "severity",
  "header": "Severity",
  "type": "enum:severity_5",
  "bindings": "severity",
  "filterable": true
}
Filterable columns display a filter icon in the header. Sorting works independently of filtering.
Columns with serverRender are always filterable and sortable by their rendered text content, even if the underlying data is complex.

Sorting Nested Columns

For nested columns (displaying properties from linked items), sorting operates on the linked item’s property, not the link itself:
{
  "id": "harmSeverity",
  "header": "Harm Severity",
  "bindings": "harm.severity",
  "type": "enum:severity_5"
}
Clicking “Harm Severity” sorts by the severity value of the linked harm item, not by the harm item’s ID.

Common Issues

Read-only columns (formula columns, serverRender columns, reference columns) are fully sortable. The readOnly property affects editing, not sorting.
Multi-item link columns sort by concatenated labels of all linked items. Unsaved items (prefixed with *) sort with the asterisk intact, appearing before saved items alphabetically.

Verification

After configuring sorting:
  1. Open your RISKSHEET
  2. Verify the initial sort matches your sortBy configuration
  3. Click column headers to test interactive sorting
  4. Use Ctrl/Cmd + Click to build multi-column sort criteria
  5. Check that work item IDs and outline numbers sort correctly
You should see columns sorted according to your configuration, with proper handling of special data types like work item IDs and hierarchical outline numbers.

See Also

KB ArticlesSupport TicketsSource Code
  • RiskItemsODataCollectionView.ts
  • SortManager.ts
  • AppConfig.ts
  • PolarionAppConfigManager.java
  • risksheet.json