|
app.component.html
<e-aggregates>
<e-aggregate>
<e-columns>
<e-column field="Freight" type="Custom" [format]="C2" [customAggregate]="customAggregateFn">
<ng-template #footerTemplate let-data>Count: {{data.Custom}}</ng-template>
</e-column>
</e-columns>
</e-aggregate>
</e-aggregates>
………………………………………………………………………
app.component.ts
customAggregateFn(data, column) {
var grid = (document.getElementById('Grid') as any).ej2_instances[0]; //Grid Instance
var r = 0;
for (var i = 0; i < grid.getSelectedRecords().length; i++) {
r = grid.getSelectedRecords()[i].Freight + r;
}
return r;
} |
|
rowSelected(args) {
(this.grid.aggregateModule as any).refresh();
}
deselect(args) {
(this.grid.aggregateModule as any).refresh();
} |