2012-10-01

Hide column in JQuery DataTable

Sometimes you want to keep ID in DataTable to be the key when edit/delete item from DataTable, but you don't want user to see the ID.
You can hide ID column by using:

$(document).ready(function() {
$('#example').dataTable( {
"aoColumns": [ null, null, { "bSearchable": false, "bVisible": false }, { "bVisible":    false }, null] } );
} );

No comments: