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>
|