DataTables FILTER CHECKBOX YES or NO
DataTables FILTER CHECKBOX YES or NO
Alex2019
Posts: 62Questions: 9Answers: 0
in DataTables
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
There is not enough context around your code snippets to understand what you are doing. Please provide a simple test case showing what you are trying to do so we can offer suggestions.
https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case
Kevin
solved, my mystake