Adding Bootstrap to Datatables no longer hides column
Adding Bootstrap to Datatables no longer hides column
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
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.
Any thoughts on what's going on here?