New default settings in new DataTables releases
New default settings in new DataTables releases
I ran into a problem where, after upgrading from DataTables 1.9 to 1.10 a while back, I found out after a lot of debugging today that there's a new default setting in 1.10.0 called stateDuration. I hadn't seen that in the upgrade notes so had no knowledge of its existence, and it caused a lot of problems for me. Maybe this is a rare occurrence, but is there a place that lists things like new default settings for each version of DataTables? Defaults across all functions. That would've been extremely helpful.
Thanks,
Chris
P.S. - I love DataTables. Allan is amazing.
This question has an accepted answers - jump to answer
Answers
Hi Chris,
The old iCookieDuration option should still work - I've just put together a little test case to check that this is the case: http://live.datatables.net/botiqeyi/1/edit . The
$.fn.dataTableSettings[0].iStateDuration
variable is just where DataTables stores that information internally - it shouldn't be used as a public interface, but is useful for debugging this kind of thing.Regarding the update - 1.10 is unusual in that camelCase is now the preferred form for parameters - therefore there is a special guide available.
Normally information such as this would be in standard release notes.
Regards,
Allan
I meant in the case of using custom state saving in 1.9, iCookieDuration had no effect. Now suddenly the equivalent stateDuration/iStateDuration affects custom state saving. Not a big deal, but it was a surprise since the functionality changed and it wasn't called out in any upgrade guides as far as I could tell.
I'm probably a rare case in being negatively affected by this. I just wanted to talk about it in case there's anyone else that doesn't know about this change or other changes with similar effects.
Thanks!
I see what you mean. Yes that was a bug in 1.9 - or at least I considered it as such. With the change to localStorage I realised that I had been relying on the cookie timing out to clear stale state information, which wasn't a complete solution.
Thanks for flagging it up - it is the first time I've come across this, but very much worth having a note of it for anyone else searching for it.
Allan