mirror of
https://github.com/koalyptus/TableFilter.git
synced 2024-05-03 07:03:33 +02:00
Page:
1.17 State
Pages
1.0 Configuration
1.01 Appearance
1.02 Main features
1.03 Grid layout
1.04 Paging
1.05 Drop down filter
1.06 Checklist filter
1.07 Rows counter
1.08 Loading indicator
1.09 Submit and reset button
1.10 Status bar
1.11 Data types
1.12 Themes
1.13 Help instructions
1.14 Popup filters
1.15 No results message
1.16 Highlight keywords
1.17 State
1.18 Mark active columns
1.19 Toolbar
1.20 Single filter
2.0 TableFilter class
2.1 Public properties
2.2 Public methods
3.0 Extensions
3.1 Advanced grid
3.1 Sort
3.2 Column operations
3.3 Filters visibility
3.4 Columns visibility
4. Filter operators
Home
Obsolete
TODO
7
1.17 State
cjohnsonuk edited this page 2016-06-21 15:44:57 +01:00
With the State
manager, TableFilter
can easily persist features state via hash
, localStorage
or cookie
. The State
object reacts to the features state changes and emits a state-changed
event along with a state object to be persisted by the relevant listeners, ie Storage
object.
Property | Type | Description | Remarks | Example |
---|---|---|---|---|
types | array | an array specifying the persistence type, that is:
|
var tfConfig = { state: { types: ['local_storage'] }; |
|
filters | boolean | if set true, columns filter values will be persisted via selected storage type (default - true) | disabled only if explicitly set false |
var tfConfig = { state: { types: ['hash'], filters: false }; |
page_number | boolean | if set true, the current page number will be persisted via selected storage type (default - false) | applicable only if paging is enabled |
var tfConfig = { paging: true, state: { types: ['hash'], page_number: true }; |
page_length | boolean | if set true, the page length (number of lines per page) will be persisted via selected storage type (default - false) | applicable only if paging is enabled |
var tfConfig = { paging: true, state: { types: ['hash'], page_length: true }; |
sort | boolean | if set true, the currently sorted column will be persisted via selected storage type (default - false) | applicable only if sort extension is enabled |
var tfConfig = { extensions: [{ name: 'sort'}], state: { types: ['cookie'], sort: true }; |
columns_visibility | boolean | if set true, currently hidden columns will be persisted via selected storage type (default - false) | applicable only if colsVisibility extension is enabled |
var tfConfig = { extensions: [{ name: 'colsVisibility'}], state: { types: ['cookie'], columns_visibility: true }; |
filters_visibility | boolean | if set true, filters row visibility will be persisted via selected storage type (default - false) | applicable only if filtersVisibility extension is enabled |
var tfConfig = { extensions: [{ name: 'filtersVisibility'}], state: { types: ['cookie'], filters_visibility: true }; |
cookie_duration | number | cookie duration expressed in hours if persistence type is cookie (default - 87600) |
applicable only if cookies is chosen as the persistence type | var tfConfig = { state: { types: ['cookie', 'hash'], cookie_duration: 100000 }; |