GroupSummary
Displays a summary row as a group footer in a grouped grid. Uses the same configuration options on columns as Summary.
This feature is disabled by default.
new Grid({
features : {
group : 'city',
groupSummary : true
},
columns : [
{ text : 'Score', data : 'score', width : 80, sum : 'sum' }
{ text : 'Rank', data : 'rank', width : 80, sum : 'average', summaryRenderer: ({ sum }) => return 'Average rank ' + sum }
]
})
//<code-header>
fiddle.title = 'Group summary';
//</code-header>
const grid = new Grid({
appendTo : targetElement,
// makes grid as high as it needs to be to fit rows
autoHeight : true,
features : {
group : 'city',
groupSummary : true
},
data : DataGenerator.generateData(10),
columns : [
{ field : 'name', text : 'Name', flex : 1 },
{ field : 'city', text : 'City', flex : 1, summaries : [{ sum : 'count', label : 'Rows' }] },
{ field : 'score', text : 'Score', flex : 1, summaries : [{ sum : 'avg', label : 'Average' }] }
]
});Configs
11
Configs
11Other
Configure as true to have group summaries rendered in the group header when a group is collapsed.
const grid = new Grid({
features : {
groupSummary : {
collapseToHeader : true
}
}
});
Only applies when target is 'footer' (the default).
Where to render the group summaries to, either header to display them in the group header or footer
to display them in the group footer (the default).
const grid = new Grid({
features : {
groupSummary : {
target : 'header'
}
}
});
Misc
Properties
17
Properties
17Common
Class hierarchy
Other
Set to true to have group summaries rendered in the group header when a group is collapsed.
Only applies when target is 'footer' (the default).
Where to render the group summaries to, either header to display them in the group header or footer
to display them in the group footer (the default).
Functions
29
Functions
29Other
Refreshes the summaries
Configuration
Events
Misc
Events
5
Events
5Event handlers
5
Event handlers
5Typedefs
1
Typedefs
1CSS variables
1
CSS variables
1| Name | Description |
|---|---|
--b-group-summary-background | Background for group summary cells |