What does the data of the footer template represent? I am trying to access some custom properties that I added to the grid. It would make sense to me that the data parameter in the template function would somehow represent the grid.
If not, is there anyway to get the grid during template processing? I have a hierarchical grid and need to know which one is rendering when I render the template.
Thanks,
Eric
If not, is there anyway to get the grid during template processing? I have a hierarchical grid and need to know which one is rendering when I render the template.
Thanks,
Eric
5 Answers, 1 is accepted
0
Hello Eric,
Footer template data contains dataSource aggregates (not group aggregates). As a general information templates can execute JavaScript expressions. You can use this feature to check what exactly the template data contains in your specific case. The following example demonstrates how to output the template data inside browser console.
I hope this will help.
Kind regards,
Alexander Valchev
the Telerik team
Footer template data contains dataSource aggregates (not group aggregates). As a general information templates can execute JavaScript expressions. You can use this feature to check what exactly the template data contains in your specific case. The following example demonstrates how to output the template data inside browser console.
{ field:
"foo"
, footerTemplate:
"
# console.log(data); #
<div>Min: #= min #</div>"
}
I hope this will help.
Kind regards,
Alexander Valchev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0

Software
Top achievements
Rank 1
answered on 27 Mar 2013, 11:47 AM
My source data already has aggregates calculated. Is there any way to use that data in the footer?
{
"id": 1,
"description"
:
"hello"
,
"customAggregate": 22,
"lines"
[
{
"id"
: 1, "data": 5 },
{
"id"
: 2, "data": 5 }
]
}
0
Hi Eric,
If I understood correctly you would like to calculate the aggregates on the server. In that case, you may turn serverAggregates on and configure the schema. Then you would be able to access the aggregates in the footerTemplate without troubles.
Kind regards,
Alexander Valchev
the Telerik team
If I understood correctly you would like to calculate the aggregates on the server. In that case, you may turn serverAggregates on and configure the schema. Then you would be able to access the aggregates in the footerTemplate without troubles.
Kind regards,
Alexander Valchev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0

Software
Top achievements
Rank 1
answered on 01 Apr 2013, 12:55 PM
I still can't seem to get this to work. I've attached my html file with the javascript I am trying to use.
I've attached my data and my code.
It seems that no matter how I set my schema/aggregates, I get no values within my templates (which are currently empty).
thanks,
Eric
I've attached my data and my code.
It seems that no matter how I set my schema/aggregates, I get no values within my templates (which are currently empty).
thanks,
Eric
0

Software
Top achievements
Rank 1
answered on 01 Apr 2013, 06:13 PM
I figured out that you also need to have the aggregate property set so kendo knows which columns contain aggregates.