<?xml version="1.0" encoding="UTF-8" ?>
<dt-example table-type="html" order="10">

<css lib="datatables" />
<js lib="jquery" />
<js lib="datatables" />

<title>State saving</title>
<js><![CDATA[
$(document).ready(function() {
	$('#example').DataTable( {
		stateSave: true
	} );
} );
]]></js>

<info><![CDATA[

DataTables has the option of being able to save the state of a table (its paging position, ordering state etc) so that is can be restored when the user reloads a page, or comes back to the page after visiting a sub-page. This state saving ability is enabled by the `dt-init stateSave` option.

The built in state saving method uses the HTML5 `localStorage` and `sessionStorage` APIs for efficient storage of the data. Please note that this means that the built in state saving option **will not work with IE6/7** as these browsers do not support these APIs. Alternative options of using cookies or saving the state on the server through Ajax can be used through the `dt-init stateSaveCallback` and `dt-init stateLoadCallback` options.

The duration for which the saved state is valid and can be used to restore the table state can be set using the `dt-init stateDuration` initialisation parameter (2 hours by default). This parameter also controls if `localStorage` (0 or greater) or `sessionStorage` (-1) is used to store the data.

The example below simply shows state saving enabled in DataTables with the `dt-init stateSave` option.

]]></info>

</dt-example>
