option to display only certain columns

option to display only certain columns

james Kjames K Posts: 4Questions: 3Answers: 1

I was looking at this question ..
https://datatables.net/forums/discussion/7168/option-to-display-only-certain-columns

Would like to know how to do the same with the latest version of Datatable

Thank you

Answers

  • kthorngrenkthorngren Posts: 21,117Questions: 26Answers: 4,916

    Yes. Here is a page that describes converting the legacy commands to the current version:
    https://datatables.net/upgrade/1.10-convert

    Although you can use the old names as in the thread you referenced but its less confusing to be consistent with the rest of your Datatables.

    The current version commands would look like this:

        columnDefs: [ 
          { "visible": true, "targets": [ 0,1,2,3 ] },
          { "visible": false, "targets": [ '_all' ] }
        ] 
    

    Kevin

This discussion has been closed.