Is it possible to have multiple aggregates from different columns in the groupHeaderTemplate?
In this example, I can get the count of campaigns in the header, but I would like to have sum of the AmountReceived also in the groupheader. Is this possible
$(document).ready(
function
() {
$(
"#grid"
).kendoGrid({
dataSource: {
type:
"json"
,
transport: { read:
"GetData"
},
group: [{
field:
"Campaign_Desc"
,
aggregates: [
{ field:
"Campaign_Desc"
, aggregate:
"count"
},
{ field:
"AmountReceived"
, aggregate:
"sum"
},
]
}],
aggregate: [
{ field:
"Campaign_Desc"
, aggregate:
"count"
},
{ field:
"AmountReceived"
, aggregate:
"sum"
},
]
},
columns: [
{ field:
"DonorName"
, title:
"Donor"
},
{ field:
"DateReceived"
, title:
"Date"
},
{ field:
"ReceiptNbr"
, title:
"Rcpt #"
},
{ field:
"AmountReceived"
, title:
"Amount"
, footerTemplate:
"Total: #=sum#"
, groupFooterTemplate:
"Total: #=sum#"
},
{ field:
"Campaign_Desc"
, title:
"Campaign"
, footerTemplate:
"Total Count: #=count#"
, groupHeaderTemplate:
"<b>#= value #</b> - Count: #=count#"
},
{ field:
"Source_Desc"
, title:
"Source"
},
{ field:
"TenderType_Desc"
, title:
"Tender"
},
{ field:
"CheckNumber"
, title:
"Check #"
},
{ field:
"GLBatchNumber"
, title:
"Batch"
}
],
scrollable:
false
,
sortable:
true
,
filterable:
true
});
});