File: DataTable.versionCheck%28%29.xml

package info (click to toggle)
datatables.js 1.11.5%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 22,848 kB
  • sloc: javascript: 65,075; xml: 10,712; php: 4,741; sh: 544; makefile: 18
file content (40 lines) | stat: -rw-r--r-- 1,837 bytes parent folder | download
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
38
39
40
<?xml version="1.0" encoding="UTF-8" ?>
<dt-api group="static">
	<name>DataTable.versionCheck()</name>
	<summary>Version number compatibility check function</summary>
	<since>1.11</since>

	<type type="function">
		<signature>versionCheck( version )</signature>
		<description>Check the compatibility of the running version of DataTables against a version string</description>
		<param type="string" name="version">
			Version string to check for, in the format "X.Y.Z". Note that the formats "X" and "X.Y" are also acceptable.
		</param>
		<returns type="boolean">`true` if this version of DataTables is greater or equal to the required version, or `false` if this version of DataTales is not suitable</returns>
	</type>

	<description>
		This method provides the ability for plug-in developers to check a required version number against the running version of DataTables. For example, a plug-in such as [Buttons](/extensions/buttons) might require DataTables 1.10.7 or newer. This method provides the ability to check that.

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

		Prior to DataTables 1.11 this method could be accessed through the `$.fn.dataTable` object only. As of 1.11, either `DataTable` or `$.fn.dataTable` can be used.
	</description>

	<example title="Non-jQuery: Check the compatibility of DataTables"><![CDATA[

if ( ! DataTable.versionCheck( '1.11' ) ) {
	alert( 'DataTables 1.11 or newer is required' );
} 

]]></example>

	<example title="jQuery: Check the compatibility of DataTables"><![CDATA[

if ( ! $.fn.dataTable.versionCheck( '1.10.7' ) ) {
	alert( 'A newer version of DataTables is required' );
} 

]]></example>

</dt-api>