File: stateLoaded.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 (48 lines) | stat: -rw-r--r-- 2,383 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
38
39
40
41
42
43
44
45
46
47
48
<?xml version="1.0" encoding="UTF-8" ?>
<dt-event>
	<name>stateLoaded</name>
	<summary>State loaded event - fired once state has been loaded and applied.</summary>
	<since>1.10</since>

	<type type="function">
		<signature>function( e, settings, json )</signature>
		<parameter type="object" name="e">
			jQuery event object
		</parameter>
		<parameter type="DataTables.Settings" name="settings">
			DataTables settings object
		</parameter>
		<parameter type="object" name="data">
			State information read from storage
		</parameter>
		<scope>HTML table element</scope>
	</type>

	<description>
		The `dt-event stateLoaded` event differs from the `dt-event stateLoadParams` in that it is fired after the state has been loaded and applied to the table (internally - the effects will not yet have been drawn onto the page upon execution of this event). This this case, the state object cannot be modified, while with `dt-event stateLoadParams` it can be. This event is usual for custom or plug-in parameters being loaded and applied from the state storage.

		The `dt-event stateLoaded` event is the event compliment of the `dt-init stateLoaded` callback initialisation option. The event is fired at the same time as the callback (technically the callback fires before the event, but they occur sequentially and thus either can be used to achieve the same effect).

		Please note that, as with all DataTables emitted events, this event is triggered with the `dt` namespace. As such, to listen for this event, you must also use the `dt` namespace by simply appending `.dt` to your event name, as shown in the example below.
	</description>

	<example title="Show custom saved data in an input element"><![CDATA[
$('#example')
	.dataTable()
	.on( 'stateLoaded.dt', function (e, settings, data) {
		$('#myInput').val( data.myCustomValue );
	} );
]]></example>

	<related type="api">state()</related>
	<related type="api">state.clear()</related>
	<related type="api">state.loaded()</related>
	<related type="api">state.save()</related>
	<related type="option">stateSave</related>
	<related type="option">stateSaveCallback</related>
	<related type="option">stateLoadParams</related>
	<related type="option">stateLoaded</related>
	<related type="option">stateSaveParams</related>
	<related type="event">stateLoadParams</related>
	<related type="event">stateSaveParams</related>
</dt-event>