1
0
Fork 0
mirror of https://github.com/koalyptus/TableFilter.git synced 2024-06-08 08:52:32 +02:00

Updated 1.17 State (markdown)

koalyptus 2016-04-11 11:40:40 +02:00
parent cb13c9980e
commit f44edd71be

@ -1 +1,48 @@
TBA
<p>With <code>State</code> manager, <code>TableFilter</code> can easily persist the features state via hash, localStorage or cookie. <code>State</code> reacts to the state changes and provides an object to be persisted by the selected mean, ie localStorage.</p>
<table>
<thead>
<tr>
<th>Property</th>
<th>Type</th>
<th>Description</th>
<th>Remarks</th>
<th>Example</th>
</tr>
</thead>
<tbody>
<tr>
<td>types</td>
<td>array</td>
<td><p>an array specifying the persistence type, that is:</p>
<ul>
<li><code>hash</code> (URL hash)</li>
<li><code>local_storage</code></li>
<li><code>cookie</code></li>
</ul>
</td>
<td></td>
<td><code>var tfConfig = { state: { types: ['local_storage'] };</code></td>
</tr>
<tr>
<th>filters</th>
<td>boolean</td>
<td>if set true, columns filter values will be persisted via selected storage type (default - true)</td>
<td>disabled only if explicitly set <code>false</code></td>
<td><code>var tfConfig = { state: { types: ['hash'], filters: false };</code></td>
</tr>
<tr>
<th>page_number</th>
<td>boolean</td>
<td>if set true, the current page number will be persisted via selected storage type (default - false)</td>
<td>applicable only if <code>paging</code> is enabled</td>
<td><code>var tfConfig = { paging: true, state: { types: ['hash'], page_number: true };</code></td>
</tr>
<tr>
<th>page_length</th>
<td>boolean</td>
<td>if set true, the page length (number of lines per page) will be persisted via selected storage type (default - false)</td>
<td>applicable only if <code>paging</code> is enabled</td>
<td><code>var tfConfig = { paging: true, state: { types: ['hash'], page_length: true };</code></td>
</tr>
</tbody>
</table>