DataTables FILTER CHECKBOX YES or NO

DataTables FILTER CHECKBOX YES or NO

Alex2019Alex2019 Posts: 62Questions: 9Answers: 0

Hello everyone,
I have this code that filters the values from checkbox,

var incoll = $('input:checkbox[name="incoll"]:checked').map(function() {
     return this.value;
   }).get().join('|');
  
 //now filter in column 7, with no regex, no smart filtering, not case sensitive
  table.column(7).search(incoll, true, false, false).draw(false);

it works u other fields very well, but what I would like to filter are only 2 values "Yes" or "No"
I tried but it doesn't work modified so

   var incoll = $('input:checkbox[name="incoll"]:checked').map(function() {
       if ( data[7] == "Yes") {
     return this.value;
       };
       }).get().join('|');
   
   //now filter in column 7, with no regex, no smart filtering, not case sensitive
   table.column(7).search(incoll, true, false, false).draw(false);

This question has an accepted answers - jump to answer

Answers

Sign In or Register to comment.