Adding Bootstrap to Datatables no longer hides column

Adding Bootstrap to Datatables no longer hides column

jdiekhoffjdiekhoff Posts: 3Questions: 1Answers: 0

I'm adding the datatables bootstrap scripts to make my tables responsive for mobile sites. There are columns on some of my tables that I want to hide from end users, usually database ids for communicating with the server. I set up the table as follows:

$("#my-table").DataTable({
"columnDefs": [
{
"targets": [0],
"visible": false,
"searchable": false
}]
});

And that works as expected. However, when I add the bootstrap scripts, it stops working, and the column is being shown. How do I keep this column hidden with the datatables bootstrap scripts?

Answers

  • jdiekhoffjdiekhoff Posts: 3Questions: 1Answers: 0

    It seems to be the dataTables.responsive.js file. If I remove that, the column is hiding properly, but no longer using the responsive styling.

  • jdiekhoffjdiekhoff Posts: 3Questions: 1Answers: 0

    Any thoughts on what's going on here?

This discussion has been closed.