File: row%28%29.id%28%29.xml

package info (click to toggle)
datatables.js 1.10.13%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 6,232 kB
  • ctags: 1,329
  • sloc: xml: 10,249; php: 4,387; sh: 492; makefile: 21
file content (38 lines) | stat: -rw-r--r-- 1,437 bytes parent folder | download | duplicates (6)
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
<?xml version="1.0" encoding="UTF-8" ?>
<dt-api group="rows">
	<name>row().id()</name>
	<summary>Get the id of the selected row.</summary>
	<since>1.10.8</since>

	<type type="function">
		<signature>row().id( [ hash ] )</signature>
		<description>Get the id of the selected row.</description>
		<parameter name="hash" type="boolean" default="false">
			* `true` - Append a hash (`#`) to the start of the row id. This can be useful for then using the id as a selector
			* `false` - Do not modify the id value.
		</parameter>
		<returns type="string">Row id. If the row does not have an id available `-type undefined` will be returned.</returns>
	</type>

	<description>
		This method can be used to get a row's id, as specified by the row's data and the `dt-init rowId` option. Optionally it can also prepend a hash (`#`) to the row id allowing it to then easily be used as a selector.

		**Important** This method does not read the DOM id for the `-tag tr` element, but rather gets the row id from the row's data source (location specified by `dt-init rowId`).
	</description>

	<example title="Click handler that shows row id"><![CDATA[

var table = $('#myTable').DataTable();

$('#myTable').on( 'click', 'tr', function () {
	var id = table.row( this ).id();

	alert( 'Clicked row id '+id );
} );

]]></example>

	<related>dt-init rowId</related>
	<related>dt-api row().id()</related>
	<related>dt-api rows().ids()</related>
</dt-api>