File: column%28%29.footer%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 (37 lines) | stat: -rw-r--r-- 1,973 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
<?xml version="1.0" encoding="UTF-8" ?>
<dt-api group="columns">
	<name>column().footer()</name>
	<summary>Get the footer node for the selected column.</summary>
	<since>1.10</since>

	<type type="function">
		<signature>column().footer()</signature>
		<description>Get the footer `dt-tag th` / `dt-tag td` cell for the selected column.</description>
		<returns type="node|null">Footer cell node for the selected element or `null` if the matched column does not have a footer cell.</returns>
	</type>

	<description>
		This method can be used to obtain (and therefore modify) the footer cell for a column. This may be a `dt-tag th` or `dt-tag td` element depending on the HTML for your table.

		The cell returned is the cell from the first row in the table `dt-tag tfoot` element relating to the selected column. If you have multiple rows in the footer that you wish to manipulate you must use the `dt-api table().footer()` method to obtain the table footer element and then use standard DOM / jQuery methods to manipulate the node.

		Furthermore, the cells in the `dt-tag tfoot` may span multiple columns using `colspan` (they can also use `rowspan`, but again, only the cells in the first row will be available using this method). As such, a cell which uses `colspan` may belong to multiple columns.

		Table footers are optional in DataTables. If the table for the column in the result set does not have a footer tag, `null` will be returned as the result.

		Note that if the selector used in `dt-api column()` matches more than one column, the result set will be truncated to a single column - the first one in the result set.
	</description>

	<example title="Sum column 0 and insert the resulting value into its footer"><![CDATA[
var table = $('#example').DataTable();
var column = table.column( 0 );

$( column.footer() ).html(
	column.data().reduce( function (a,b) {
		return a+b;
	} )
);
]]></example>

	<related type="api">column().footer()</related>
</dt-api>