File: slice%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 (34 lines) | stat: -rw-r--r-- 1,303 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
33
34
<?xml version="1.0" encoding="UTF-8" ?>
<dt-api group="utility">
	<name>slice()</name>
	<summary>Create an independent copy of the API instance.</summary>
	<since>1.10.15</since>

	<type type="function">
		<signature>slice()</signature>
		<description>Create an independent copy of the API instance.</description>
		<returns type="DataTable.Api">API instance</returns>
	</type>

	<description>
		The DataTables API object is "array like" and inherits many of the same characteristics as a Javascript array. The `-api slice()` method is one of these. It provides the ability to create an independent copy of the instance so it can be manipulated without affecting the original.

		This method is a proxy for the Javascript `Array.prototype.slice` 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 `slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice).
	</description>

	<example title="Modify a copy of an instance without affecting the original."><![CDATA[
var table = $('#example').DataTable();

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

var data2 = data.slice();

data2.push( 'Fini' );

// `data` is unaffected

]]></example>

</dt-api>