Last active
December 26, 2015 12:48
-
-
Save donovan-duplessis/7153420 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
datatables instantiation options: | |
save/load in localstorage | |
bStateSave: true | |
fnStateSave: (oSettings, oData) -> | |
localStorage.setItem window.location.hostname.replace(/\./g, '_') + "_DataTables_" + window.location.pathname, JSON.stringify(oData) | |
fnStateLoad: (oSettings) -> | |
JSON.parse localStorage.getItem(window.location.hostname.replace(/\./g, '_') + "_DataTables_" + window.location.pathname) | |
iCookieDuration: 60*60*24, # 1 day (in seconds) | |
re-populate individual column filters: | |
fnInitComplete: (oSettings, json) -> | |
cols = oSettings.aoPreSearchCols | |
i = 0 | |
while i < cols.length | |
value = cols[i].sSearch | |
$("thead input")[i].value = value if value.length > 0 | |
i++ | |
localstorage keys: | |
0_0_0_0_DataTables_/admin/divisions:{"iCreate":1382700973490,"iStart":0,"iEnd":0,"iLength":25,"aaSorting":[[0,"asc",0]]...} | |
0_0_0_0_DataTables_/admin/home:{"iCreate":1382700839163,"iStart":0,"iEnd":0,"iLength":25,"aaSorting":[[0,"asc",0]],...} | |
0_0_0_0_DataTables_/admin/products:{"iCreate":1382701318218,"iStart":0,"iEnd":0,"iLength":25,"aaSorting":[[0,"asc",0]]...} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment