DataTable.isDataTable()

Since: DataTables 1.11

Check is a table node is a DataTable or not.

Description

This method provides the ability to check if a table node is already a DataTable or not. This can be useful to ensure that you don't re-initialise a table that is already a DataTable.

Please note that this is a static function and is accessed through the DataTable object, not an API instance. It can be accessed at any time, even before any DataTables have been created on the page.

Type

isDataTable( table )

Check if a table node is a DataTable table already or not.

Parameters:

Returns:

boolean: true the given table is a DataTable, false otherwise

Example

Check if #example is a DataTable or not. If not, initialise:

if (!DataTable.isDataTable('#example')) {
	new DataTable('#example');
}