DataTable filtering and paging
DataTable filtering and paging
How do I filter my table on the values of a certain column. My showAll function needs to show everything except for records with 'I' in column 12, and my showNon fuction needs to ONLY show records that have 'I','R', or 'W' in column 12. Also, I only display 10 records per page and it only sorts on what is displayed on each individual page instead of the whole data set (so if I have 15 records it fiters the first 10, then when I go to the second page it filters the last 5 seperately.) How can I fix this?
table is populated via HTML
Right now I have
function showAll(){
var theTable = $('#myTable').dataTable({
"columnDefs":[{"orderable":false, "targets":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22]}],
"searching":false,
"sorting":[[8,"desc"]],
"paging":false,
"filtering":false,
"autoWidth":false,
"info":false,
"destroy":true
});
}
function showNon(){
var theTable = $('#myTable').dataTable({
"columnDefs":[{"orderable":false, "targets":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22]}],
"searching":false,
"sorting":[[8,"desc"]],
"paging":false,
"filtering":false,
"autoWidth":false,
"info":false,
"destroy":true
});
}