Row Grouping, title sorting, + Footer Callback?
Row Grouping, title sorting, + Footer Callback?
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
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
This discussion has been closed.
Replies
var nCells = nRow.getElementsByTagName('th');
nCells[1].innerHTML = total;
$(nCells[1]).formatCurrency({negativeFormat:'%s-%n'});
(using formatCurrency plugin).