Colvis
Colvis
I use ColVis for hide and show some columns.
The problem is that the name of column dont show in table as in picture.
https://plus.google.com/photos/105055309659346003591/albums/6116794673382457569/6116794675345328034?enfplm&hl=en&utm_source=lmnavbr&utm_medium=embd&utm_campaign=lrnmre&rtsl=1&pid=6116794675345328034&oid=105055309659346003591
$(document).ready(function() {
var table = $('#example').dataTable({
aoColumns: [
{ "bVisible": true },
{ "bVisible": true },
{ "bVisible": true },
{ "bVisible": true },
{ "bVisible": true },
{ "bVisible": true },
{ "bVisible": true },
{ "bVisible": true },
{ "bVisible": true },
{ "bVisible": true },
{ "bVisible": true },
{ "bVisible": true },
{ "bVisible": true },
{ "bVisible": true },
{ "bVisible": true },
{ "bVisible": true },
{ "bVisible": true },
{ "bVisible": true },
{ "bVisible": true },
{ "bVisible": false },
{ "bVisible": false },
{ "bVisible": false },
{ "bVisible": false },
{ "bVisible": false },
{ "bVisible": false },
{ "bVisible": false },
{ "bVisible": false },
{ "bVisible": false }
],
dom:'RMD<"cvclear"C><"clear"T>lfrtip',
colVis: {
// mouseover the button and the column hide display for choice
activate: "mouseover",
bSortCellsTop: true,
buttonText: "RECORDED TIMES",//the name of button
showAll: "Show all",//tab forshow all hide tabe
showNone: "Show none",
exclude: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18]
}
}) .columnFilter({
sPlaceHolder: "head:after", aoColumns: [
null,
{ type: "select" },
{ type: "select" },
{ type: "select" },
{ type: "text" },
null,
null,
null,
{ type: "select" },
{ type: "select" },
{ type: "text" },
{ type: "select" },
{ type: "select" },
{ type: "select" },
{ type: "select" },
null,
{ type: "select" },
{ type: "select" },
{ type: "select" },
]
});
});
<script type="text/javascript" src="Scripts/jquery.dataTables.js"></script>
<script type="text/javascript" src="Scripts/dataTables.colVis.js"></script>
<script type="text/javascript" src="Scripts/jquery.dataTables.columnFilter.js"></script>
<script type="text/javascript" src="Scripts/myscript.js"></script>