I am looking for a way to get to know if the tables in a page are dataTable or not? Is there an easy way to find it? Or may be if I can get all the objects of dataTable.
function isDataTable( table ) Description: Check if a table node is a DataTable table already or not.
Searching on individual columns can be performed using the columns().search() and column().search() methods. DataTables has a built in search algorithm referred to as "smart" searching and is designed to make searching the table data, easy to use for the end user.
You can use the fnDrawCallback function. It gets called every time the table is drawn. This would include when the table is loaded with data, sorted or filtered. This worked for me.
function tables( [ visible ] )As a boolean value this options is used to indicate if you want all tables on the page should be returned ( false ), or visible tables only ( true ).
There's a static method in the DataTables plugin, so you may verify as:
$('table').each(function() {
// this method accepts the DOM node (table element) as parameter
if ( $.fn.dataTable.fnIsDataTable(this) ) {
// do your thing to the table
}
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With