File: stateDuration.xml

package info (click to toggle)
datatables.js 1.10.21%2Bdfsg-2%2Bdeb11u1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 22,604 kB
  • sloc: javascript: 64,254; xml: 10,441; php: 4,623; sh: 523; makefile: 21
file content (35 lines) | stat: -rw-r--r-- 1,475 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-option group="option">
	<name>stateDuration</name>
	<summary>Saved state validity duration</summary>
	<since>1.10</since>

	<type type="integer" />
	<default value="7200" />

	<description>
		Duration for which the saved state information is considered valid. After this period has elapsed the state will be returned to the default.

		This option is also used to indicate to DataTables if `localStorage` or `sessionStorage` should be used for storing the table's state. When set to `-1` `sessionStorage` will be used, while for 0 or greater `localStorage` will be used.

		The difference between the two storage APIs is that `sessionStorage` retains data only for the current session (i..e the current browser window). For more information on these two HTML APIs please refer to the [Mozilla Storage documentation](https://developer.mozilla.org/en-US/docs/Web/Guide/API/DOM/Storage).

		Please note that the value is given in seconds. The value `0` is a _special_ value as it indicates that the state can be stored and retrieved indefinitely with no time limit.
	</description>

	<example title="Set state duration to 1 day"><![CDATA[
$('#example').dataTable( {
  "stateSave": true,
  "stateDuration": 60 * 60 * 24
} );
]]></example>

	<example title="Use `sessionStorage`"><![CDATA[
$('#example').dataTable( {
  "stateSave": true,
  "stateDuration": -1
} );
]]></example>

	<related type="option">stateSave</related>
</dt-option>