Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 83002

[fnFilter] Display nothing if no checkboxes selected

$
0
0

Right now my datatable is displaying all records, if no checkboxes are selected.

How to display no results, if no checkboxes are selected?

function filterCourses() {
  otable = $('#datatable').dataTable();
  //build a regex filter string with an or(|) condition
  var courses = $('input:checkbox[name="status"]:checked').map(function() {
    return '^' + this.value + '\$';
  }).get().join('|');
  //filter in column 0, with an regex, no smart filtering, no inputbox,not case sensitive
  otable.fnFilter(courses, 10, true, false, false, false);
}

Viewing all articles
Browse latest Browse all 83002

Trending Articles