File: reverse%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 (32 lines) | stat: -rw-r--r-- 1,414 bytes parent folder | download | duplicates (4)
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
<?xml version="1.0" encoding="UTF-8" ?>
<dt-api group="utility">
	<name>reverse()</name>
	<summary>Reverse the result set of the API instance.</summary>
	<since>1.10</since>

	<type type="function">
		<signature>reverse()</signature>
		<description>Reverse the result set of the API instance and return the original array.</description>
		<returns type="DataTables.Api">The original API instance with the result set in reversed order.</returns>
	</type>

	<description>
		This method will quite simply take the elements in an API instance's result set and reverse the order of those element, in place. This is particularly used when used with the `dt-api sort()` method.

		This method makes use of the fact that DataTables API objects are "array like", in that they inherent a lot of the abilities and methods of the Javascript `Array` type.

		In this case, this method is a proxy for the Javascript `Array.prototype.reverse` method and is provided as a utility method for the DataTables API. For more information about the original method, please refer to the [Mozilla MDN documentation for `reverse`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reverse).
	</description>

	<example title="Sort and reverse the data from a column"><![CDATA[
var table = $('#example').DataTable();

var data = table
	.column( 0 )
	.data()
	.sort()
	.reverse();

]]></example>

</dt-api>