Skip to content

DataColumn: add support for DateGroupType#2152

Open
bschwarzent wants to merge 2 commits into
releases/26.2from
features/bsh/26.2/date-column-grouping
Open

DataColumn: add support for DateGroupType#2152
bschwarzent wants to merge 2 commits into
releases/26.2from
features/bsh/26.2/date-column-grouping

Conversation

@bschwarzent
Copy link
Copy Markdown
Member

269392

@bschwarzent bschwarzent self-assigned this Apr 20, 2026
@bschwarzent bschwarzent requested a review from cguglielmo April 20, 2026 18:09
Comment thread eclipse-scout-core/src/prefs/TableUiPreferences.ts Outdated
Comment thread eclipse-scout-core/src/table/columns/DateColumn.ts
Comment thread eclipse-scout-core/src/table/columns/DateColumnTableHeaderMenu.ts Outdated
Comment thread eclipse-scout-core/src/table/columns/DateColumnTableHeaderMenu.ts Outdated
Comment thread eclipse-scout-core/src/table/Table.ts Outdated
Comment thread eclipse-scout-core/src/table/Table.ts
Comment thread eclipse-scout-core/src/table/TableHeaderMenu.ts
Comment thread eclipse-scout-core/src/table/columns/DateColumn.ts Outdated
Comment thread eclipse-scout-core/src/table/TableMatrix.ts Outdated
Comment thread eclipse-scout-core/src/table/columns/DateColumnTableHeaderMenu.ts Outdated
Comment thread eclipse-scout-core/src/table/columns/DateColumnModel.ts
Comment thread eclipse-scout-core/src/table/columns/DateColumnTableHeaderMenu.ts Outdated
- New enum DateGroupType:
  YEAR, MONTH, MONTH_AND_YEAR, CALENDAR_WEEK, WEEKDAY, DATE
- New property "groupType" on date columns
- New DateColumnTableHeaderMenu for date columns

FEATURE DESCRIPTION:

Instead of only grouping DateColumns by year, the user can now change
the group type as desired. The new DateGroupType enum offers multiple
options, several of which are not achievable with a simple date format
pattern (e.g. month or weekday). The user is presented with a list
of options when they click the "group by" button in the table header
menu of a date column. For grouped date columns, the grou type can
be changed without reload the data.

Technically, the grouping uses the TableMatrix helper object, which
was extended to support all new date group types. Date values are
normalized to a type-specific numeric value which also defines the
sort order (e.g. months are not just sorted alphabetically but in
the "natural" order from January to December).

The default grouping is still by year. Support for a custom group format
for a specific column is still present, but setting the new "groupType"
property takes precedence. If the custom format matches one of the
group types, it is automatically treated as a group type. The selected
group type is stored along with the existing "groupingActive" property
in the table ui preferences.

The same group types can also be applied to the filter table in the
table header menu of date columns. The user can change the group type
for the filter table (not the actual data table in the background) by
clicking the calendar icon above the filter table. For example, this
allows the user to filter the table rows by weekday. By default, the
filter group type is the same was the aggregation group type, but a
different value can be chosen.

269392
@bschwarzent bschwarzent force-pushed the features/bsh/26.2/date-column-grouping branch from a76cc71 to 6988bcd Compare May 5, 2026 13:32
DateColumnTableHeaderMenu:
- Try to identify corresponding DateGroupType for custom date format
  pattern
- Optimize column widths in filter table after changing date group
  type to prevent cutting off the content
- Remove _contextMenu member, instead find popup by anchor
- Use custom DateGroupTypeContextMenuPopup
- Initialize filter with column.groupType, even when grouping is not
  active

TableUiPreferences:
- Use setGroupType()
- Don't overwrite existing values with undefined if preference value
  is missing
- Store groupType explicitly as "null" if grouping is not active

DateColumn:
- Create cached _groupTypeAxis when setting groupType
- Add "applyGrouping" argument to setGroupType() to opt-out from
  automatically updating the table rows (useful if applying multiple
  changes to the table).

ContextMenu:
- Use initial value of 'cloneMenuItems' (e.g. set by constructor) if
  init model does not specify a value.

Other:
- Use DateUtility.toLocalDate()
- Use removeGroupColumn()
- Improve documentation
- Add more tests
@bschwarzent bschwarzent force-pushed the features/bsh/26.2/date-column-grouping branch from 6988bcd to 80293ec Compare May 5, 2026 14:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants