File: %24.fn.dataTable.isDataTable%28%29.xml

package info (click to toggle)
datatables.js 1.10.19%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 6,348 kB
  • sloc: xml: 10,397; php: 4,448; sh: 521; makefile: 21
file content (37 lines) | stat: -rw-r--r-- 1,460 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?xml version="1.0" encoding="UTF-8" ?>
<dt-api group="static">
	<name>$.fn.dataTable.isDataTable()</name>
	<summary>Check is a table node is a DataTable or not</summary>
	<since>1.10</since>

	<type type="function">
		<signature>isDataTable( table )</signature>
		<description>Check if a `-tag table` node is a DataTable table already or not.</description>
		<parameter type="string|node|jQuery|DataTable.Api" name="version">
			The table to check. This can be given as one of:

			* A DOM element
			* A jQuery selector
			* A jQuery object containing the node to check
			* A DataTables API instance.

			Note that only the first node is checked if the jQuery selector or object match multiple nodes.
		</parameter>
		<returns type="boolean">`true` the given table is a DataTable, `false` otherwise</returns>
	</type>

	<description>
		This method provides the ability to check if a `-tag 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 `$.fn.dataTable` object, not an API instance. It can be accessed at any time, even before any DataTables have been created on the page.
	</description>

	<example title="Check if `#example` is a DataTable or not. If not, initialise"><![CDATA[

if ( ! $.fn.DataTable.isDataTable( '#example' ) ) {
  $('#example').dataTable();
}

]]></example>

</dt-api>