bStateSave not sending cookie.

bStateSave not sending cookie.

victorkurauchivictorkurauchi Posts: 12Questions: 1Answers: 0
edited March 2013 in DataTables 1.9
Hi everyone.

I'm having a problem with the bStateSave property in DataTables 1.9.
The attribute is enable (true) but when i filter some data and go to another page, when i return the filter isn't there anymore.

[code]
$('.example').dataTable({
"bPaginate": true,
"bRetrieve": true,
"bDestroy": true,
"bSortClasses": false,
"bStateSave": true,
"iCookieDuration": 3600,
"sPaginationType": "full_numbers"
});
[/code]

Using Chrome, I verified the page information (right-click button) and the cookie wasn't set.

Need support, thank you all.

Replies

  • allanallan Posts: 63,534Questions: 1Answers: 10,475 Site admin
    Need a link to a test case.

    Also don't use both bRetrieve and bDestroy - they are mutually exclusive and cannot be used together.
  • victorkurauchivictorkurauchi Posts: 12Questions: 1Answers: 0
    Solved allan!

    First time reading the usage, I thought that bDestroy and bRetrieve supposed to use together. My bad.
    Which one should I remove ?

    Probably the problem was on the class selector (in the same view, i have two datatables.)

    Solution: The most important table have an ID now, then i'm rendering by it.

    [code]
    // Datatable
    $('.example').dataTable({
    "bPaginate": true,
    "bRetrieve": true,
    "bDestroy": true,
    "bSortClasses": false,
    "bStateSave": false,
    "sPaginationType": "full_numbers"
    });

    // Datatable
    $('#datatable-worklist').dataTable({
    "bPaginate": true,
    "bStateSave": true
    });
    [/code]
This discussion has been closed.