start setting not restored from state with serverSide?

start setting not restored from state with serverSide?

HobieCatHobieCat Posts: 2Questions: 1Answers: 0

Hello there,

I have a page with a dataTable that uses stateSave, serverSide and ajax. It looks like the selected page is not restored when the page is reloaded.
As an example: I load the page with the dataTable that will have let's say 200 rows, displayed 10 rows per page. Afterwards I click page 5 and I can see the proper start setting being successfully updated in the session storage where the state is being saved. But then, if i reload the page I am back to page 1 (not page 5) and the start setting in the state object is back to zero. Please note that column sorting, filtering and lengthMenu selections are correctly reset as they where before the reload, only the page (and the start setting by the way) is not.

Please find below my code:

$('#mytable').DataTable({
    "stateSave": true,
    "stateDuration": -1,
    "deferRender": false,
    "serverSide" : true,
    "processing" : true,
    "rowId": 'idcompetitor',
    "searchDelay" : 500,
    "dom": 'lfrtip',
    "lengthMenu": [ 10, 25, 50, 100, 500 ],
    "ajax": {
        "url" : "ajax/getCompetitors.php",
        "type" : "GET"
    }
});

Has anybody faced an issue like this and can share an hint?

Thanks a lot!

Answers

This discussion has been closed.