Row Grouping, title sorting, + Footer Callback?

Row Grouping, title sorting, + Footer Callback?

awvidmerawvidmer Posts: 8Questions: 0Answers: 0
edited January 2012 in General
Thanks for this, Allan, it's a wonderful tool!

I haven't had any luck trying to get a "fnFooterCallback" working at the same time as the .rowGrouping plugin. To add to the complexity, I would like to total a "title" attribute (unformatted currency) that I'm using for the sort.

Here is my initialization code. Without the display line, it works fine:

[code] $(document).ready(function(){
$('table#transTable').dataTable({




"bPaginate": false,
"bScrollCollapse": true,
"sScrollY": "318px",
"aaSorting": [[ 2, "desc" ],[3, "desc"]],
"sDom": "<'row'<'span16'f>>t<'row'i<'span8'><'span8'>>",


"aoColumns": [
{ "bSortable": false },
null,
null,
null,
null,
{ "sType": "title-numeric" },
null,
null
],
"fnFooterCallback": function ( nFoot, aaData, iStart, iEnd, aiDisplay ) {


/* Calculate the total transactions on this page */
var iPageTotal = 0;
for ( var i=iStart ; i

Replies

  • awvidmerawvidmer Posts: 8Questions: 0Answers: 0
    For anyone else interested, I needed to remove the "sType" line, and then was able to add the display code:

    var nCells = nRow.getElementsByTagName('th');
    nCells[1].innerHTML = total;
    $(nCells[1]).formatCurrency({negativeFormat:'%s-%n'});

    (using formatCurrency plugin).
This discussion has been closed.