Colvis state save not working

Colvis state save not working

ririckririck Posts: 11Questions: 0Answers: 0
edited March 2012 in General
Hi,
I'd like that the visibility of the displayed columns to be saved between user's sessions.
I tried with the "bStateSave": true options but it doesn't seems to be working.
Is there a way to achieve this?

Replies

  • allanallan Posts: 63,538Questions: 1Answers: 10,476 Site admin
    That should work okay. Could you run your table over the debugger when the visibility has been changed and the page reloaded ( http://debug.datatables.net )? A link would be great as well.

    Thanks,
    Allan
  • ldopsonldopson Posts: 4Questions: 0Answers: 0
    edited July 2012
    I fought with a ColVis problem for a few hours because it was not loading the proper state. Each time I refreshed the browser it would default to all columns visible. I thought it may have been related to cookies so I converted to localState.

    After much debugging I found the problem.

    saved_aoColumns state was correct but it was somehow ignoring it.

    fnDetectHeader and _fnGetUniqueThs look for a hardcoded "table header" with column values, if this does not exist, ColVis state will not work.

    I've been using datatables without headers as it allows me more portability and less places to change things i.e: header, aocolumns, aocolumndefs.

    Leo
This discussion has been closed.