KendoGrid custom aggregate function

KendoGrid custom aggregate function hack

View the Project on GitHub ChristfriedBalizou/kendo-grid-custom-aggregate-function-hack

kendoGrid custom aggregate function

The kendo lib does not allow to inject your custom library. This script allow you to add your custom aggregation function using columns.groupFooterTemplate option.

Usage

You custom aggregation function will receive a list of data per group which is exactly what you need to aggregate yourself. Return the value/ string that should be display.

Html

<!DOCTYPE html>
<html>
<head>
<!-- YOUR CSS HERE -->
</head>
<body>
...
<div id="#grid"></div>
...
<script><!-- jQuery here --></script>
<script><!-- kendo.all.min.js here --></script>
<script src="kendo.aggregate.helper.js"></script>
</body>
</html>

Javascript

function myAggregate(data){
// Data here is a list of data by group (brilliant right! :-) )
// Do anything here and return result string
}

var grid = $('#grid').kendoGrid({
...
columns: [
  { field: '', title: '', groupFooterTemplate: myAggregate
]
...
});

Good to Know

This git repo did not import kendo library because of license. Please think about adding it yourself in your project before using it.

AND BUY A LICENSE!!!

Todo