GroupingList Controller
The GroupingList controller renders a data grid with all records grouped by a specified field, featuring collapsible group headers with expand/collapse toggles. Unlike the standard List controller, GroupingList loads all records at once (no paging) and organizes them into visual groups.
It inherits from the List controller, reusing its filter panel, toolbar, column headers, and standard actions (Add, Edit, View, Delete). The only difference is in how records are displayed: instead of a flat paginated table, records appear under collapsible group headings.
Basic usage
Set Controller: GroupingList on the view and configure the Grouping node under MainTable/Controller:
Type: Data
Controller: GroupingList
MainTable:
Model: ACTIVITY
Controller:
Grouping:
FieldName: TYPE
StartCollapsed: True
ShowCount: True
ItemName: activity
PluralItemName: activitiesThis produces a grid where activities are grouped by the TYPE field (resolved through its reference to display the type name), with each group initially collapsed. The group header shows the type name and the count of records, for example: Analysis (5 activities).
Grouping configuration
All grouping properties go under MainTable/Controller/Grouping:
| Property | Type | Default | Description |
|---|---|---|---|
FieldName | String | (required) | Name of the field to group by. Can be any field including reference fields (which display the referenced value) or expression-based fields. |
StartCollapsed | Boolean | False | If True, all groups appear initially collapsed (only the group header is visible). Users can click to expand. |
ShowCount | Boolean | False | If True, shows the record count in each group header. |
ShowCount/ItemName | String | (empty) | Singular noun used when count is 1 (e.g. activity). |
ShowCount/PluralItemName | String | (empty) | Plural noun used when count > 1 (e.g. activities). |
ShowName | Boolean | False | If True, prefixes the group value with the field's display label (e.g. Type: Analysis instead of just Analysis). |
SortFieldNames | String | (grouping field) | Space-separated list of field names for the ORDER BY clause. Defaults to the grouping field. Use this to add a secondary sort within each group. |
Group header format
The group header text is built as follows:
- ShowName: False (default):
Analysis - ShowName: True:
Type: Analysis - ShowCount: True with count=1 and ItemName:
Analysis (1 activity) - ShowCount: True with count>1 and PluralItemName:
Analysis (5 activities) - ShowCount: True without ItemName/PluralItemName:
Analysis (5)
Sorting
By default, records are sorted by the grouping field only. Use SortFieldNames to define a multi-field sort:
Grouping:
FieldName: TYPE
SortFieldNames: TYPE ACTIVITY_DATEThis sorts first by TYPE (to keep groups together), then by ACTIVITY_DATE within each group. Each field name in the list must correspond to a field defined in the view table.
Expand/Collapse behavior
- Clicking a group header toggles the visibility of the data rows in that group.
- The toggle icon changes between ▶ (collapsed) and ▼ (expanded).
- The toggle is pure client-side JavaScript (no server round-trip).
Filters
GroupingList supports the same filter system as the List controller. If a Filters node is defined under Controller, the filter panel is rendered above the grid and all records are reloaded (with the filter applied) when the user changes filter criteria.
Toolbar and actions
The toolbar is identical to the List controller: Add, Edit, View, Delete, Refresh, and custom ToolViews are all supported. Double-clicking a data row opens the form in Edit or View mode (depending on permissions).
Complete example
From the TasKitto sample application (ActivitiesByType.yaml):
Type: Data
Controller: GroupingList
MainTable:
PluralDisplayLabel: Activities by Type
Model: ACTIVITY
EditController:
CloneButton:
Width: 1220
Height: 460
Controller:
Form:
Layout: ActivityInput_Form
Grouping:
FieldName: TYPE
EnableMenu: False
StartCollapsed: True
ShowName: False
ShowCount: True
ItemName: activity
PluralItemName: activities
SortFieldNames: TYPE ACTIVITY_DATEDifferences from List controller
| Feature | List | GroupingList |
|---|---|---|
| Paging | Yes (configurable page size) | No (all records loaded) |
| Record display | Flat rows | Grouped with collapsible headers |
| Sorting | User-clickable column sort with arrow indicators | Fixed sort by SortFieldNames |
| Filters | Supported | Supported |
| Toolbar | Supported | Supported |
| Double-click | Opens form | Opens form |
