fnFooterCallback Issue Upon Pagination

fnFooterCallback Issue Upon Pagination

dobulet302dobulet302 Posts: 38Questions: 0Answers: 0
edited January 2011 in General
I am using server side processing and when I jump from page 1 to page 2 or any other page my script breaks and gives me the following error.

aaData[aiDsiplay[i] is undefined and it takes me to this in my code.

total=total+parseFloat(aasData[aiDisplay[i]][columnaActual]);

Not sure what I am missing, however here is my full code.


[code]


$(document).ready(function() {
var oTable;
oTable = $('#reports_table').dataTable( {
"sDom": '<"H"Tlfr>t<"F"ip>' ,
"swfPath": "swf/ZeroClipboardPdf.swf",
"oTableTools": {
"buttons": [
"copy",
"xls",
"pdf",
{ "type": "print", "buttonText": "Print" }
]
},
"aLengthMenu": [[10, 25, 50, -1], [10, 25, 50, "All"]],
"sPaginationType": "full_numbers",
"aaSorting": [[ 4, "desc" ]],
"bPaginate": true,
"bJQueryUI": true,
"bProcessing": true,
"bServerSide": true,
"oLanguage": {
"sInfoFiltered": ""
},
"sAjaxSource": "?page=reports_process",
"fnServerData":function (sSource, aoData, fnCallback) {
aoData.push({"name":"admin_sub_reports", "value":$('#admin_sub_reports').val() });
aoData.push({"name":"company", "value":$('#company_id').val() });
aoData.push({"name":"source", "value":$('#source_id').val() });
aoData.push({"name":"date_Range", "value":$('#date_Range').val() });
aoData.push({"name":"time", "value":$('#time').val() });
aoData.push({"name":"reports_type", "value":$('#reports_type').val() });
$.getJSON( sSource, aoData, function(json) {
fnCallback(json)
});
},
"aoColumnDefs": [
{ "sClass": "column_class", "aTargets": [ 1,2,3,5,6,7,8] },
{ "sClass": "net_gross_class", "aTargets": [ 4 ] },
{
"aTargets": [3,4,5,6,7,8],
"sType": 'numeric',
"bUseRendered": false,
"fnRender": function ( o ) {
var number = o.aData[o.iDataColumn ];
var number = CommaFormatted(number);
strArray = number.split(".");
return "$"+strArray[0]+"."+strArray[1].slice(0,-4)+""+strArray[1].substr(strArray[1].length-4,4);;
}
},
{
"aTargets": [5,6,7,8],
"bUseRendered": false,
"fnRender": function ( o ) {
return o.oSettings.fnFormatNumber( parseFloat( o.aData[ o.iDataColumn ] ) );
}
}
],
"fnFooterCallback": function (nRow, aasData, iStart, iEnd, aiDisplay ) {
$($(nRow).children()).remove();
for(var i=0;i
This discussion has been closed.