Footer sum: visualizing only the coloumn i want to visualize
Footer sum: visualizing only the coloumn i want to visualize
Hi all, i have a problem with visualizing footer sum of cells that are above the sum in my table. In particular I want that the sum in the footer follow the coloumn not only when i move that coloumn, but also when i move the coloumn and after that i use the search function. Now what happens is that if i move the coloum also the footer sum moves, but if then i try to use the search, that sum is not displayed.
Other things is that i tryed also to display the sum of the coloumn,that i only want to display, using sName property of a coloumn.For exemple if i want to display some coloumns sums i have tryed to set the sName of that coloumn to "true" otherwise "false". But when i try to get back the values of sName of my coloumns i'm not sure if using dataTableOpt.fnSettings().aoColumns[v].sName is oki or works.
Anyone know how i can solve my problems??
Thank you in advance
Other things is that i tryed also to display the sum of the coloumn,that i only want to display, using sName property of a coloumn.For exemple if i want to display some coloumns sums i have tryed to set the sName of that coloumn to "true" otherwise "false". But when i try to get back the values of sName of my coloumns i'm not sure if using dataTableOpt.fnSettings().aoColumns[v].sName is oki or works.
Anyone know how i can solve my problems??
Thank you in advance
This discussion has been closed.
Replies
Allan
dataTableOpt.aoColumns=new Array();
for(var j=0;j
Allan
var nCells = nRow.getElementsByTagName('th');
In my table i have for example the column 2,4,5 numeric and i only want the total of the coloumn 2,4 in the footer. How i can discriminate?Only with the coloumn position?I think no because if i let the user to move the coloumns the code try to do the sum of a coloumn which contain a string i supposed.
Thank you
/* Calculate the market share for browsers on this page */
var iPageMarket = 0;
for ( var i=iStart ; i
Allan
Setting the sName parameter:
if(indicepresente==true){obj.sName="true";} // if the indexes matches
else {obj.sName="false";}
dataTableOpt.aoColumns.push(obj);
It's oki?
Then i tried to get the sName parameter value of coloumns in this mode:
for(var i=0;i
In that example that Allan showed me
http://datatables.net/release-datatables/examples/advanced_init/footer_callback.html
the column of the table are fixed (the user can't reoder the coloumn). What happens if is allowed the column reorder by user? I think that calculating the sum of the coloumn 4 (fixed) give errors right?
So If it is possible i want that the user can arbitrally reorder the coloumn, without losing the sum on the footer. How i can do that?
Allan
"false" or "true" depending from other parameters. Then i check the sName property with this code:
//loop the aoColumns array
for (i = 0; i < oTable.fnSettings().aoColumns.length; i++) {
if (oTable.fnSettings().aoColumns[i].sName == "true"){
var visibleIndex=this.fnSettings().oApi._fnColumnIndexToVisible(this.fnSettings(),i);
if(visibleIndex){
if(sums[i]){
$('#example tfoot th:eq('+visibleIndex+')').html(''+sums[i]+'');
}
}
}
}
Now there is a problem that is, when i move a column and then i use the "Search" option for filtering some row the footer sum disappear. What function is call andwhat happens when in dataTable is used the "search" option?