Bug 39930: Prevent DT's state to be lost overnight
The default value for stateDuration is 7200 (2h). Which means DataTables
will ignore the saved state if reused after this delay.
Additionally is causes problem on some tables where the default state is
not restored and all columns are displayed.
From https://datatables.net/reference/option/stateDuration
```
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.
```
We are going to set it to 0 so that the state is only lost/reset after a
logout
Test plan:
Ideally you can should edit this file and set saveState to 60 (seconds),
so it's easy to test.
Do not apply this patch and confirm that the state is not restored after
either 60s or 2h (if you modified the file or not).
It is a problem on the checkout list table as extra columns (like
"Today's checkouts") are displayed.
With this patch applied the state should be restored correctly.
If you logout the state will be lost however.
Ideally we might want to store user's preferences on the server.
Signed-off-by: Ludovic Julien <ludovic.julien@inLibro.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit ad11a32584)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
This commit is contained in:
parent
8ac94d1226
commit
c2a7a1906c
|
|
@ -1270,6 +1270,7 @@ function _dt_save_restore_state(table_settings, external_filter_nodes = {}) {
|
|||
|
||||
return {
|
||||
stateSave: true,
|
||||
stateDuration: 0,
|
||||
stateSaveCallback,
|
||||
stateLoadCallback,
|
||||
stateSaveParams,
|
||||
|
|
|
|||
Loading…
Reference in New Issue