$(document).ready(function() { /* Column Filter */ cf = $('#column-filter').DataTable({ headerCallback:function(e, a, t, n, s) { e.getElementsByTagName("th")[0].innerHTML='' }, columnDefs:[ { targets:0, width:"30px", className:"", orderable:!1, render:function(e, a, t, n) { return'' } }], "oLanguage": { "oPaginate": { "sPrevious": '', "sNext": '' }, "sInfo": "Showing page _PAGE_ of _PAGES_", "sSearch": '', "sSearchPlaceholder": "Search...", "sLengthMenu": "Results : _MENU_", }, "stripeClasses": [], "lengthMenu": [7, 10, 20, 50], "pageLength": 7 }); multiCheck(cf); /* Individual Column Search */ // Setup - add a text input to each footer cell $('#individual-col-search tfoot th').each( function () { var title = $(this).text(); $(this).html( '' ); } ); // DataTable var table = $('#individual-col-search').DataTable({ "oLanguage": { "oPaginate": { "sPrevious": '', "sNext": '' }, "sInfo": "Showing page _PAGE_ of _PAGES_", "sSearch": '', "sSearchPlaceholder": "Search...", "sLengthMenu": "Results : _MENU_", }, "stripeClasses": [], "lengthMenu": [7, 10, 20, 50], "pageLength": 7 }); // Apply the search table.columns().every( function () { var that = this; $( 'input', this.footer() ).on( 'keyup change', function () { if ( that.search() !== this.value ) { that .search( this.value ) .draw(); } } ); } ); /* Show Hide column */ var table = $('#show-hide-col').DataTable( { "scrollY": "283px", "paging": false, "oLanguage": { "oPaginate": { "sPrevious": '', "sNext": '' }, "sInfo": "Showing page _PAGE_ of _PAGES_", "sSearch": '', "sSearchPlaceholder": "Search...", "sLengthMenu": "Results : _MENU_", }, "stripeClasses": [], "lengthMenu": [7, 10, 20, 50], "pageLength": 7 } ); $('a.toggle-vis').on( 'click', function (e) { e.preventDefault(); // Get the column API object var column = table.column( $(this).attr('data-column') ); // Toggle the visibility column.visible( ! column.visible() ); } ); } );