Skip to content

Commit

Permalink
extending newGroup parameter of summaryType of grouping
Browse files Browse the repository at this point in the history
The property `keys` is added to `newGroup` parameter of the callback function `summaryType` of grouping. See [the issue](#227) for more details.
  • Loading branch information
OlegKi committed Apr 30, 2016
1 parent 4d50fdc commit 6f85d2d
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions js/grid.grouping.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
this.each(function () {
var $t = this, grp = $t.p.groupingView, groups = grp.groups, counters = grp.counters,
lastvalues = grp.lastvalues, isInTheSameGroup = grp.isInTheSameGroup, groupLength = grp.groupField.length,
i, newGroup, counter, fieldName, v, displayName, displayValue, changed = false,
i, j, keys, newGroup, counter, fieldName, v, displayName, displayValue, changed = false,
groupingCalculationsHandler = base.groupingCalculations.handler,
buildSummary = function () {
var iSummary, summary, st;
Expand Down Expand Up @@ -136,7 +136,20 @@
displayValue = v;
}
if (v !== undefined) {
newGroup = { idx: i, dataIndex: fieldName, value: v, displayValue: displayValue, startRow: irow, cnt: 1, summary: [] };
keys = [];
for (j = 0; j <= i; j++) {
keys.push(record[grp.groupField[j]]);
}
newGroup = {
idx: i,
dataIndex: fieldName,
value: v,
displayValue: displayValue,
startRow: irow,
cnt: 1,
keys: keys,
summary: []
};
if (irow === 0) {
// First record always starts a new group
groups.push(newGroup);
Expand Down

0 comments on commit 6f85d2d

Please sign in to comment.