Calculating Column Total for all non-filtered entries
Calculating Column Total for all non-filtered entries
Basically what the discussion title states: I need to calculate 3 columns total for all non filtered items; not just what's on the DOM.
I found this topic: http://datatables.net/forums/discussion/823/calulating-totals-for-multiple-columns-through-fnfootercallback/p1
I broke it down into this
[code]
"fnFooterCallback": function (nRow, aasData, iStart, iEnd, aiDisplay ) {
if(iEnd > 0) { // if search result is empty do nothing
var column=[8, 9, 10]; //the columns you wish to add
for(var j in column) {
var total=0;
for(var i=iStart;i
I found this topic: http://datatables.net/forums/discussion/823/calulating-totals-for-multiple-columns-through-fnfootercallback/p1
I broke it down into this
[code]
"fnFooterCallback": function (nRow, aasData, iStart, iEnd, aiDisplay ) {
if(iEnd > 0) { // if search result is empty do nothing
var column=[8, 9, 10]; //the columns you wish to add
for(var j in column) {
var total=0;
for(var i=iStart;i
This discussion has been closed.
Replies
Allan
I want the total to update on fnDrawCallBack but the issue is, is that it seems that the table initializes before the plugin is processed. So in my console, I am receiving that fnGetColumnData does not exist. I tried using $.isFunction( oTable.fnGetColumnData ) but I don't think I am using that right.
Any suggestions?
For now, I did:
[code]
if ( typeof oTable == 'undefined' ) return;
[/code]
Allan