File: ajax.url%28%29.load%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 (40 lines) | stat: -rw-r--r-- 1,660 bytes parent folder | download | duplicates (3)
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
<?xml version="1.0" encoding="UTF-8" ?>
<dt-api group="core">
	<name>ajax.url().load()</name>
	<summary>Load data from the newly set data source URL</summary>
	<since>1.10</since>

	<type type="function">
		<signature>ajax.url().load( callback, resetPaging )</signature>
		<parameter type="function" name="callback" default="null">
			Function which is executed when the data has been reloaded and the table fully redrawn. The function is given a single parameter - the JSON data returned by the server, and expects no return.
		</parameter>
		<parameter type="boolean" name="resetPaging" default="true">
			Reset (default action or `true`) or hold the current paging position (`false`). A full re-sort and re-filter is performed when this method is called, which is why the pagination reset is the default action.
		</parameter>
		<returns type="DataTables.Api">
			DataTables.Api instance
		</returns>
	</type>

	<description>
		Trigger a load of an Ajax data source when a URL has been set using the `dt-api ajax.url()` method.

		Note `dt-api ajax.url()` must be used as a setter to set the URL for the `load()` method to be available in the returned object.
	</description>

	<example title="Set the Ajax URL and load the data from the new source immediately"><![CDATA[
var table = $('#example').DataTable( {
	ajax: "data.json"
} );

table.ajax.url( 'newData.json' ).load();
]]></example>

	<related type="option">ajax</related>
	<related type="api">ajax.json()</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>