Skip to content
This repository has been archived by the owner on Nov 11, 2022. It is now read-only.

ChristfriedBalizou/kendo-grid-custom-aggregate-function-hack

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

kendoGrid custom aggregate function (Demo)

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

  • Import jQuery lib
  • Import Kendo lib
  • Import this script (kendo.aggregate.helper.js)

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

  • Use aggregation with multiple groupBy
  • Test aggregation with inner details view
  • Free memory variable after aggregation complete

About

KendoGrid custom aggregate function hack

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published