File: language.url.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 (45 lines) | stat: -rw-r--r-- 1,677 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
<?xml version="1.0" encoding="UTF-8" ?>
<dt-option group="i18n">
	<name>language.url</name>
	<summary>Load language information from remote file</summary>
	<since>1.10</since>

	<type type="string" />

	<description>
		All of the language options DataTables provides can be stored in a file on the server, which DataTables will look up if this parameter is passed. The file must be a valid JSON file, and the object it contains has the same properties as the `dt-init language` object in the initialiser object.

		There are a wide range of translations readily available on this site, in the [internationalisation plug-ins](//datatables.net/plug-ins/i18n).

		Note that when this parameter is set, DataTables' initialisation will be asynchronous due to the Ajax data load. That is to say that the table will not be drawn until the Ajax request has completed. As such, any actions that require the table to have completed its initialisation should be placed into the `dt-init initComplete` callback.
	</description>

	<example title="Load language information from a remote file"><![CDATA[
$('#example').dataTable( {
  "language": {
    "url": "/dataTables/i18n/de_de.lang"
  }
} );
]]></example>

	<example title=""><![CDATA[
$('#example').dataTable( {
  "language": {
    "url": "/dataTables/i18n/de_de.lang"
  },
  "initComplete": function () {
  	var api = this.api();

  	// Put the sum of column 5 into the footer cell
  	$( api.column( 5 ).footer() ).html(
  		api.column( 5 ).data().reduce( function (a, b) {
  			return a + b;
  		} )
  	);
  }
} );
]]></example>

	<related type="option">language</related>
	<related type="option">initComplete</related>
</dt-option>