Skip to content

Instantly share code, notes, and snippets.

@bradfordbradford
Created October 20, 2014 14:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bradfordbradford/2c37f4ab00b9b643e070 to your computer and use it in GitHub Desktop.
Save bradfordbradford/2c37f4ab00b9b643e070 to your computer and use it in GitHub Desktop.
$(document).ready(function() {
var table_b = $('#table-b')
.dataTable({
responsive: true,
stateSave: true,
"pagingType": "simple",
"dom": '<"top"<"form-row"f><"form-row"<"left"l><"right paginate-button-group"ip>>>',
"language": {
"search": "<span class='search-label'>Search</span> _INPUT_ "
},
"oLanguage": {
"oPaginate": {
"sNext": "<span class='on-right' data-icon='c'></span>",
"sPrevious": "<span class='on-left' data-icon='d'></span>"
}
}
})
.columnFilter(
{
(bla,bla…)
});
// API
var api = table_b.api();
// Trying to Incorporate This:
// Toggle Column Visibility
$('.toggle-vis input').on('ifClicked', function(event){
var column = table_b.column( $(this).attr('data-column') );
column.visible( ! column.visible() );
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment