3 Answers, 1 is accepted
0
Accepted
Hello Wyatt,
Alex Gyoshev
the Telerik team
You can achieve this through the DataSource aggregates and a column footer template. See the grid aggregates demo and this jsBin showing how to access data across columns.
All the best,Alex Gyoshev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Joe
commented on 06 Aug 2013, 10:27 PM
Top achievements
Rank 1
How would you then take your calculated footer template example and apply #=kendo.toString(sum,'P2')# equivalent?
Thanks.
Thanks.
Alfredo
commented on 13 May 2015, 03:44 PM
Top achievements
Rank 1
How would you handle a case where the Denominator in the calculation is 0 (thus divide by zero). In my grid, where I format as Currency, it displays 'INFINITY'
0
Joe
Top achievements
Rank 1
answered on 06 Aug 2013, 10:33 PM
I've answered my own question. The solution for my calculated cross columns was:
.ClientFooterTemplate("<div>Avg: #= kendo.toString(data.TotalMarginAmt.sum / data.TotalSalesAmt.sum,'P2') # </div>")
.ClientFooterTemplate("<div>Avg: #= kendo.toString(data.TotalMarginAmt.sum / data.TotalSalesAmt.sum,'P2') # </div>")
0
Hello Alfredo,
You can have conditional expressions in templates, so you can handle this separately:
# if (isZero) { #N/A
# } else { #
formatted value
# } #
Regards,
Alex Gyoshev
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Alfredo
commented on 14 May 2015, 03:09 PM
Top achievements
Rank 1
Alex,
Thanks for your reponse. What I ended up doing was using a function in the template to check for zero. I will try your solution next time I run into this situation.
Alfredo