Posted 4 April 2023, 1:40 am EST
if (allocCollection._src.length > 0) {
let TotalSettlAmount = 0;
let TotalClientNet = 0;
let TotalRefereeFee = 0;
let TotalExpenses = 0;
let TotalWLFeePaid = 0;
let TotalWLExpPaid = 0;
for (var i = 0; i < allocCollection._src.length; i++) {
if (allocCollection._src[i].Voided != true) {
TotalSettlAmount += allocCollection._src[i].SettlementAmount;
TotalClientNet += allocCollection._src[i].ClientNetROPayment;
TotalRefereeFee += allocCollection._src[i].RefereeFee;
TotalExpenses += allocCollection._src[i].RefereeExpense;
TotalWLFeePaid += allocCollection._src[i].PaymentAmount;
TotalWLExpPaid += allocCollection._src[i].WLExpensePaid;
}
}
allocCollection._src.push({
ClientName: "Total",
SettlementAmount: TotalSettlAmount,
ClientNetROPayment: TotalClientNet,
RefereeFee: TotalRefereeFee,
RefereeExpense: TotalExpenses,
PaymentAmount: TotalWLFeePaid,
WLExpensePaid: TotalWLExpPaid
});
}
ROSearchAllocations.Grid.settings({ collection: allocCollection });
I Written the above code to do the footer. I calculated all sum and passed to the itemsource of the grid so now it is also getting sort with the data. so i want to stop the total to sort.