stateSave not retaining search box info

stateSave not retaining search box info

tooncestoonces Posts: 15Questions: 2Answers: 0

Hi guys. I've searched and searched, and found all kinds of suggestions for this problem but nothing has worked for me yet. I have a page with multiple data tables on it, and I want to save the search criteria (ie if you search "foo" and navigate away, when you come back it's still "foo"). I am using stateSave, but it seems to have no effect whatsoever. here is my code (all the other DT's are the same, just with different names) :

$('#Table1').dataTable( {
"stateSave": true,
"sDom": 'flrtip',
"aaSorting": [[ 1, "asc" ]],
"bProcessing": true,
"bServerSide": true,
"iDisplayLength": 25,
"sPaginationType": "full_numbers",
"aoColumns": [null, null, null, null, null, null, null,null, null],
"sAjaxSource": "server_processing2.php"
} );

now i'm no expert, so i'm wondering - is there an obvious mistake I've made without realizing? i see zero difference when having stateSave in there or not.

This question has an accepted answers - jump to answer

Answers

  • colincolin Posts: 15,240Questions: 1Answers: 2,599
    Answer ✓

    Hi @toonces ,

    Its working as expected for me here. We're happy to take a look, but as per the forum rules, please link to a test case - a test case that replicates the issue will ensure you'll get a quick and accurate response. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.

    Cheers,

    Colin

  • tooncestoonces Posts: 15Questions: 2Answers: 0

    Hi Colin. Because of company privacy issues, I can't post the actual page link, and I'm having a hard time to get my code (which was built to use server side processing) to work in the sandbox app you directed me to.

    The example you provided works for me too, but that's because it only has one line of config - the saveState line. Mine unfortunately has 8 or 9 settings. Not sure how i can provide a working test case. might be able to replicate it with fake data

  • tooncestoonces Posts: 15Questions: 2Answers: 0

    just fyi I managed to isolate what the problem was (kid of). I got the idea to first off, make sure all my files were up to date. My jquery and jquery ui libraries were not the latest ones, and upgrading them fixed the issue like magic.

This discussion has been closed.