I have a datable, where I use data-aggregate-type to calculate avg and sum of few columns, likewise, I want to use data-aggregate-type=”count” for one of the column to count total number of companies (companyID), but its not working. Here is what I am trying to do: Salary shows fine (data-aggregate-type=”sum” works, but data-aggregate-type=”count” doesn’t) – I want total numer of employees in the footer
<cfoutput>
<table class="datatable display">
<thead>
<tr>
<th>Name</th>
<th>Join Date</th>
<th>Employee ID </th>
<th>Salary</th>
<th>Due Date</th>
</tr>
</thead>
<tfoot class="DisplayInHeader">
<tr>
<td>Total</td>
<td></td>
<td></td>
<td class="dt-aggregate dt-right" data-aggregate-type="count" data-column-type="numeric"></td>
<td class="dt-aggregate dt-right" data-aggregate-type="sum" data-column-type="money" data-scale="2"></td>
<td></td>
</tr>
</tfoot>
</table>
JQuery:
<script>
$(document).ready(function()
{
var objTable = $(".datatable").DataTable(
{
"debug": true,
"info": false,
"paging": true,
"searching": true,
"order": [[3, "asc"]],
"language":
dom: 'Bfrtip',
buttons:
[
'excelHtml5',
'csvHtml5'
],
"columns":
[
{ data: 'EMPLOYEENAME'},
{ data: 'JOINDATE'},
{ data: 'EMPLOYEEID'},
{ data: 'SALARY', className: 'dt-right', render: $.fn.dataTable.render.number( ',', '.', 2 )}
{ data: 'DUEDATE'}
],
"footerCallback": fnFooterCallback
});
});
2