File: ajax.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 (35 lines) | stat: -rw-r--r-- 1,531 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
<?xml version="1.0" encoding="UTF-8" ?>
<dt-api group="core">
	<name>ajax</name>
	<summary>Namespace for Ajax methods</summary>
	<since>1.10</since>

	<type type="object" />

	<description>
		Ajax obtained data in DataTables is often a very convenient way of working with large data sets as it allows decoupling of the data retrieval methods from the display. At initialisation time the Ajax data options are controlled using the `dt-init ajax` option, while after initialisation the API provides a number of methods for obtaining the loaded data, altering the settings and loading new data.

		This property is a static object of the DataTables API which is used simply to provide a namespace for its child methods, which are used to control the Ajax operations DataTables can provide, and retrieve the data retrieved by Ajax requests.

		Please refer to the documentation for each of those methods for details on how they operate.
	</description>

	<example title="Show an indication of how many rows are loaded"><![CDATA[
var table = $('#example').DataTable( {
	ajax: "data.json"
} );

table.on( 'xhr', function () {
	var json = table.ajax.json();
	alert( json.data.length +' row(s) were loaded' );
} );
]]></example>

	<related type="option">ajax</related>
	<related type="api">ajax.json()</related>
	<related type="api">ajax.params()</related>
	<related type="api">ajax.url()</related>
	<related type="api">ajax.url().load()</related>
	<related type="api">ajax.reload()</related>
	<related type="event">xhr</related>
</dt-api>