Keep the Entry Number upon refreshing the webpage

Keep the Entry Number upon refreshing the webpage

K4nataaK4nataa Posts: 4Questions: 2Answers: 0

I am not very familiar with Datatables and I was wondering if it is possible to remember/keep the 'Show X entries' amount upon refreshing your webpage. Can that be done through the Jquery of DataTables.net or Will I have to obtain the information somewhere else?

``` $(document).ready(function () {

        $('#Container').DataTable({
            "scrollX": true,
            "iDisplayLength": 10,
            "aLengthMenu": [[10, 15, 20, 25, 50, -1], [10, 15, 20, 25, 50, "All"]],```

I could possibly put the aLenghtMenu in a Variable and that you can use that in a cookie to remember the amount if the user refreshes the webpage.

Thank you in advance.

This question has an accepted answers - jump to answer

Answers

  • kthorngrenkthorngren Posts: 20,309Questions: 26Answers: 4,771
    Answer ✓

    Have you looked at the stateSave option?

    Kevin

  • K4nataaK4nataa Posts: 4Questions: 2Answers: 0
    edited March 2021

    Thanks a lot for the reply, stateSave is exactly what I have been looking for!

This discussion has been closed.