I have one question. What I”m attempting to do is if there are no returned results for the table then do NOT display the pagination. What I have no does not work.
var oTable = $('#templatesPageList').dataTable( {
"sDom": 'rti<"pagination"p>',
"iDisplayLength": 10,
"sPaginationType": "full_numbers",
"fnDrawCallback":function(){
if(oTable).find("tbody tr").length(0){
$(oTable 'div.dataTables_paginate')[0].style.display = "none";
} else {
$(oTable 'div.dataTables_paginate')[0].style.display = "block";
}
}
You should do: