The above suggestions didn't help.
I have an ajax server-side, pageable implementation. As the user enters new search words it has to refresh, therefore using "fnInitComplete" is not an option, since it only triggers once, when the DataTable object is initialized.
Overriding fnServerData didn't work either.
So instead I ended implementing it by grabbing the iProcessingTime
from JSON via the dataSrc:
var table = $('#pkgTable').DataTable({
"processing" : true,
"serverSide" : true,
"sPaginationType" : "jPaginator",
"ajax": {
"url" : urlStr,
"type" : "POST",
"dataSrc": function(json) {
var iProcessingTimeMS = json.iProcessingTime;
var iProcessingTimeS = iProcessingTimeMS/1000;
$("#processingTime").html("Search Time: " + iProcessingTimeMS + " ms. " + iProcessingTimeS + " s.");
return json.aaData;
}
},
"oLanguage": {
"sProcessing": "<span style='color: red; font-weight: bold'>Please Wait...</span>",
"sZeroRecords": "No Records Found...",
"sSearch": "Search All:",
"sUrl": "",
"oPaginate": {
"sFirst" : "<b><<</b>",
"sLast" : "<b>>></b>",
"sPrevious" : "<b><</b>",
"sNext" : "<b>></b>"
},
"sLengthMenu": 'Display <select>' +
'<option value="10">10</option>' +
'<option value="20">20</option>' +
'<option value="50">50</option>' +
'<option value="100">100</option>' +
'</select> records'
}
});