Skip to content

Grouped row count recalculation: DHX-4956 - #152

Open
mafanya23 wants to merge 5 commits into
9.4from
mr-grouped-row-count-recalculation-after-filtering-4956
Open

mafanya23 wants to merge 5 commits into
9.4from
mr-grouped-row-count-recalculation-after-filtering-4956

Conversation

@mafanya23

Copy link
Copy Markdown
Contributor

No description provided.

- DataCollection group(): new "Group counters and aggregates" section on
  $count, $totalCount and map fields being recomputed after filter(),
  resetFilter(), add(), remove(), update() and parse(); showEmptyGroups
  added to the group() config
- Grid: two new properties of the group config documented in the config
  page and the "Grouping data" guide - counter and showEmptyGroups
- Grid guide: new "Group counters and aggregates" section covering the
  service properties, the filtering scope and group removal; dropped the
  note claiming that changing values doesn't affect the aggregates
- filter(), resetFilter(), add(), update() and parse() pages note the
  recalculation; a rule is matched against data rows only, so a callback
  never gets a $group or $groupSummary row
- remove(): passing the id of a group header removes the whole group
- helpers: dhx.methods signature and the new "Aggregating an empty set of
  items" section - sum and count give 0, avg, min and max give null
- grid summary config: the same for the footer of a grid with no rows
- related sample linked in the group config, guide and group() pages
The column and Grid summaries are calculated over the data rows only,
the group header rows and the group summary rows aren't counted as data.

- `configuration.md`: a note in the intro of "Custom statistics in the
  column header/footer and spans", before both summary subsections
- `grid_summary_config.md`: the same in the description, ahead of the
  empty set paragraph
- `usage.md`: a line in "Group counters and aggregates" linking back to
  the summary guide, matching the wording used for `$count`
- `data_calculation_functions.md`: the empty set condition is stated as
  "an empty or missing set of items"; the unverified case of a field
  that none of the items has is dropped
- `usage.md`: the `showEmptyGroups` example aggregates into the rendered
  "price" column instead of a `total` field that no column shows, so the
  zero total the comment mentions is actually visible
- `usage.md`, `datacollection_group_method.md`: the sentence about a
  group losing all its rows is recast so that the subject isn't
  separated from its verb by a relative clause
- datacollection group(): the new section split into "Counters of a
  group", "Aggregated fields", "Filtering grouped data" and "Removing a
  group"; the scope note turned into an admonition; the service
  properties of a header row marked as such; api names linked as code
- grid guide: the same sub-sections in "Group counters and aggregates";
  $index added next to $count and $totalCount, and $by widened to cover
  the function form of `by`
- grid group config: `by` added to IGroupOrder and to the `order`
  description, the usage snippet highlight fixed to point at `group`
- getSummary(): a note that a grouped grid counts the data rows only
- changelogs: v9.4 entries for the recalculation, the filtering scope,
  remove() on a group header, the summaries of a grouped grid, and the
  new `counter` and `showEmptyGroups` properties
- the descriptions reworded from the passive to the active voice
@mafanya23 mafanya23 self-assigned this Sep 15, 2026
<tr>
<td><b>config</b></td>
<td>(<i>object</i>) optional, the configuration of data grouping. The configuration object may include the following properties:<ul><li><b>`showMissed?: boolean | string`</b> - optional, specifies whether the elements that don't have the field for grouping should be displayed, *true* by default<ul><li>if set to *true*, the rows that don't have values for grouping are rendered row by row after all the data</li><li>if a *string* value is set, e.g. "Missed", the rows that don't have values for grouping are rendered as a separate group the name of which will have the specified string value. This group will be rendered as the last one</li><li>if set to *false*, the rows that don't suit the grouping criteria won't be rendered</li></ul></li><li><b>`field?: string`</b> - optional, the group field name, *"group"* by default</li></ul></td>
<td>(<i>object</i>) optional, the configuration of data grouping. The configuration object may include the following properties:<ul><li><b>`showMissed?: boolean | string`</b> - optional, specifies whether the elements that don't have the field for grouping should be displayed, *true* by default<ul><li>if set to *true*, the rows that don't have values for grouping are rendered row by row after all the data</li><li>if a *string* value is set, e.g. "Missed", the rows that don't have values for grouping are rendered as a separate group the name of which will have the specified string value. This group will be rendered as the last one</li><li>if set to *false*, the rows that don't suit the grouping criteria won't be rendered</li></ul></li><li><b>`showEmptyGroups?: boolean`</b> - optional, specifies whether a group that loses all its items to filtering stays in the collection, *false* by default<ul><li>if set to *false*, such a group leaves the collection together with its summary row and its nested groups, so `map()` skips it and `getLength()` leaves it out. A `resetFilter()` call brings it back</li><li>if set to *true*, such a group stays with the `$count: 0` value and emptied aggregates: the "sum" and "count" aggregations give *0*, while "avg", "min" and "max" give *null*</li></ul></li><li><b>`field?: string`</b> - optional, the group field name, *"group"* by default</li></ul></td>

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Добавлено в config:

Image

- filter(): the description split into "Combining filters" and
  "Filtering grouped data"; grid summary config: into "Summaries in a
  grouped grid" and "Summaries of an empty grid"; the related links
  moved above the headings to keep them page-level
- add(), update(), remove(): the commented @related links replaced with
  readable "Related article" ones
- changelogs: the v9.4 behavior entries dropped where they only restated
  the description, kept on group() where the section is to be moved to
  the guides later
- counter: a custom `template` hides it in the cell, while the tooltip
  keeps it until `tooltipTemplate` is redefined; the brackets dropped
  from the examples, as a counter function returns the whole string
- the same wording for the group counters across the pages, and a fixed
  highlight of the snippet in the grid guide
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.

1 participant