diff --git a/docs/example-widget-grouping.html b/docs/example-widget-grouping.html index 3361378d..da78f207 100644 --- a/docs/example-widget-grouping.html +++ b/docs/example-widget-grouping.html @@ -97,7 +97,22 @@ } // If there are empty cells, name the group "Empty" return txt === "" ? "Empty" : txt; - } + }, + group_callback : function($cell, $rows, column, table){ + // callback allowing modification of the group header labels + // $cell = current table cell (containing group header cells '.group-name' & '.group-count' + // $rows = all of the table rows for the current group; table = current table (DOM) + // column = current column being sorted/grouped + if (column === 2) { + var subtotal = 0; + $rows.each(function(){ + subtotal += parseInt( $(this).find('td').eq(column).text() ); + }); + $cell.find('.group-count').append('; subtotal: ' + subtotal ); + } + }, + // event triggered on the table when the grouping widget has finished work + group_complete : 'groupingComplete' } }); @@ -122,6 +137,7 @@