Column Visibility
Column Visibility
Jakkal
Posts: 2Questions: 1Answers: 0
Trying to hide a column including the header. Test results are the same in Firefox and Chrome.
When I use "columnDefs" the header still appears.
$('#example').DataTable( {
"columnDefs": [
{ "visible": false, "targets": [ 2 ] }
] } );
When I try using "column" or "columns" neither has any affect on visibility.
$('#example').dataTable( {
"columns": [
{ "visible": false },
null,
null,
null,
null
] } );
} );
This discussion has been closed.
Answers
Your code works just fine for me (the
Name
column is hidden).Can you please link to a test case showing the issue, as required in the forum rules.
Allan
Thanks Allan. Found the source of the problem. The following script causes the header to display for some reason.
DataTables requires jQuery 1.7+ as noted in the manual.
Allan