An error is thrown when using aggregates in ClientGroupFooterTemplate in a Grid with external DataSource #7810
Labels
Bug
C: Grid
FP: Unplanned
Sync status with associated Feedback Item
S: Wrappers (ASP.NET Core)
S: Wrappers (ASP.NET MVC)
SEV: Low
Bug report
When the Grid uses an external DataSource, the aggregates are undefined within the ClientGroupFooterTemplate().
Reproduction of the problem
Use the following REPL sample that demonstrates the issue:
https://netcorerepl.telerik.com/mIkyQnvB382bsiFt24
Group the Grid by the "Freight" column.
An error is thrown in the browser console: "Uncaught ReferenceError: sum is not defined".
The aggregates=["sum"] is missing in the column options in the Grid initialization script;
"columns":[{"title":"Order ID","field":"OrderID","filterable":false,"encoded":true},**{"title":"Freight","groupFooterTemplate":"Sum: #=sum#","field":"Freight","filterable":{"messages":{"title":"Show items with value that"},"checkAll":false},"encoded":true}**,{"title":"Ship City","width":"150px","field":"ShipCity","filterable":{"messages":{"title":"Show items with value that"},"checkAll":false},"encoded":true}]
When the DataSource is defined within the Grid configuration, the aggregate is displayed as expected.
Expected/desired behavior
The "sum" aggregate must be displayed within the group footer template of the column when the Grid is grouped.
Workaround
Define the DataSource in the Grid configuration or update the Grid settings by using the setOptions() method when the page is loaded:
Environment
The text was updated successfully, but these errors were encountered: