Wijmo UI for the Web
groupAggregate Event
The jQuery.Event object.
The data with this event.
The groupAggregate event handler is a function that is called when groups are being created and the column object's aggregate option has been set to "custom". This event is useful when you want to calculate custom aggregate values.
Syntax
Javascript (Usage) 
$(function () {
    // Set groupAggregate event handler function
    $(".selector").wijgrid({
        groupAggregate : function (e, args) {
     
        }
    });
});
Javascript (Specification) 
groupAggregate = function ( 
   e : Object,
   args : IGroupAggregateEventArgs
) { };

Parameters

e
The jQuery.Event object.
args
The data with this event.
Example
// This sample demonstrates using the groupAggregate event handler to calculate an average in a custom aggregate:
$("#element").wijgrid({
    groupAggregate: function (e, args) {
        if (args.column.dataKey == "Price") {
            var aggregate = 0;
            for (var i = args.groupingStart; i <= args.groupingEnd; i++) {
                aggregate += args.data[i].valueCell(args.column.dataIndex).value;
            }
            aggregate = aggregate/ (args.groupingEnd - args.groupingStart + 1);
            args.text = aggregate;
        }
    }
});
Remarks
You can bind to the event either by type or by name. Bind to the event by name: $("#element").wijgrid({ groupAggregate: function (e, args) { // some code here }}); Bind to the event by type: $("#element").bind("wijgridgroupaggregate", function (e, args) { // some code here });

See Also

Reference

options type
wijgrid jQuery Widget

 

 


© 2013 All Rights Reserved.

Send comments on this topic.