File: cells%28%29.render%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 (47 lines) | stat: -rw-r--r-- 2,135 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
41
42
43
44
45
46
47
<?xml version="1.0" encoding="UTF-8" ?>
<dt-api group="cells">
	<name>cells().render()</name>
	<summary>Get rendered data for a collection of cells</summary>
	<since>1.10.3</since>

	<type type="function">
		<signature>cells().render( type )</signature>
		<description>Get rendered data for the selected cells</description>
		<parameter type="string" name="type">
			Data type to get. This can be one of:

			* `-string display`
			* `-string filter` or (since 1.11) `-string search`
			* `-string sort` or (since 1.11) `-string order`
			* `-string type`
		</parameter>
		<returns type="DataTables.Api">DataTables API instance with the data for each selected cell in the result set</returns>
	</type>

	<description>
		DataTables has the ability to use [orthogonal data](/manual/orthogonal-data) - i.e. different data for the same cell, depending on the operation being performed. A typical example of this is date / time data being used in numeric format (i.e. a timestamp) for sorting, but a complex formatted form for display.

		The `dt-api cells().data()` method provides access to the underlying raw data, while this method provides access to the rendered data for each type. It is provided to allow plug-in authors access to the orthogonal data available in the table.

		Note that calling this method will evaluate the renderer for the cell, rather than reading the information from cache (see `dt-api cells().cache()` to read from cache and `dt-api cells().invalidate()` to clear cache).
	</description>

	<example title="Get the display information for the cells in a row clicked on"><![CDATA[
var table = $('#example').DataTable();

$('#example').on( 'click', 'tbody td', function () {
	var idx = table.cell( this ).index().row;
	var data = table.cells( idx, '' ).render( 'display' );

	console.log( data );
} );

]]></example>

	<related type="option">columns.data</related>
	<related type="option">columns.render</related>
	<related type="api">cells().data()</related>
	<related type="api">cell().data()</related>
	<related type="api">cell().render()</related>
	<related type="api">cell().invalidate()</related>
</dt-api>