how do I change order of a hidden column once visible dynamically

how do I change order of a hidden column once visible dynamically

storres56storres56 Posts: 2Questions: 2Answers: 0

I have a preferance setting to hide or show a column assigned to a parameter. Once initialized if the column was checked for visibility I want to make orderable false for the column. I am trying to use this idea but cannot find a good examlpe to work off.
Can it be done after iniialisation? ( FYI: I'm doing this on a jsp page..The below code works

$.extend( true, $.fn.dataTable.defaults, {
"initComplete": function(settings, json) {
alert( 'DataTables has finished its initialisation.' );
}
}

Answers

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

    Hi @storres56 ,

    I don't quite understand what you're after, but you can change the visibility of a column with column().visible(). You can't change whether a column is orderable post-initialisation through the API, but you can remove the click even listener from the header of that column (and again on every draw as it would be reinstated).

    Hope that gets you moving at least,

    Cheers,

    Colin

This discussion has been closed.