Use a check to see if loadedState has the property sp_hidden. Something like this:
if ( loadedState.hasOwnPoperty( "sp_hidden" ) {
var sp_hidden = loadedState.sp_hidden;
} else {
sp_hidden = x; // x is whatever you want the default value to be
}
I tried to implement the if statement, but it still does not work on the first click of a fresh cache. It says, "Cannot read properties of null (reading 'hasOwnProperty')"
Answers
Use a check to see if
loadedState
has the propertysp_hidden
. Something like this:Kevin
@kthorngren
http://live.datatables.net/fotorewe/19/
I tried to implement the if statement, but it still does not work on the first click of a fresh cache. It says, "Cannot read properties of null (reading 'hasOwnProperty')"
This is a standard Javascript error. Sounds like you need an additional check to see if
loadedState
is null. Checkout this tutorial.Kevin
@kthorngren
Thank you, I truly appreciate all the help! Here is the working fiddle for anyone needing it in the future: http://live.datatables.net/fotorewe/26/edit
@kthorngren
How would I make the SearchPanes collapsed on default instead of open right when you open the page?
http://live.datatables.net/fotorewe/26/edit
See this line:
setting it to
true
has the panes closed by default,Colin
Hi @ArielSAdamsNASA ,
Sorry, but that link is returning a 404 for me. Maybe it has been copied incorrectly?
Thanks,
Sandy
@colin Thank you, that works!
@sandy That is odd because the link works for me, here is the updated one: http://live.datatables.net/cayuqimo/1/edit
Hi @ArielSAdamsNASA ,
Apologies, I didn't spot that there was a second page on this thread! The link I was referring to was on the previous page - http://live.datatables.net/fotorewe/9/edit
So ignore me
Thanks,
Sandy
And oddly that link does now work! No idea what was going on in my head this morning...