DataTable drawCallback Function for specific Table
DataTable drawCallback Function for specific Table
![jdadwilson](https://datatables.net/forums/uploads/userpics/489/n6T4VGQGU7T42.jpg)
I use the following code in the drawCallback area to show/hide the paging info on a table. Works fine if only one table on the page. How do I change this if more than one table on the page?
function hide_pagingAreas ( thisApi ) {
var tableInfo = thisApi.page.info();
if (tableInfo.recordsDisplay <= tableInfo.length) {
$('div.dt-paging').hide();
$('div.dt-start').hide();
$('div.dt-end').hide();
} else {
$('div.dt-paging').show();
$('div.dt-start').show();
$('div.dt-end').show();
}
}
TIA for your assistance.
jdadwilson
This question has an accepted answers - jump to answer
Answers
I couldn't find class "dt-paging", "dt-start" etc. on my pages.
I assume you mean this when you speak about "paging info":
If you do then you'd be looking at something different:
Can you clarify please.
Try using
table().container()
. Something like this:Kevin
@rf1234
Those are new in DT 2.0 from the
layout
option.Kevin
They are indeed there for v2.0 which is what I am using. The provided code works great.
Thanks
jdadwilson