filter with count
filter with count
I have a filter checkbox and it's working perfectly, what I wanted to add next is an input of numbers beside the checkboxes to filter how many of said data to filter.
live example: http://live.datatables.net/xepaduje/3/edit
example: Let's say column 6 is a child row with images if I click the checkbox for image (1222) and input number 1 it will return rows with 1222 existing once or more, and that is the normal behavior, but if the input number is 2 it will search for rows where 1222 exist twice or more this is also working even though it's not on the example, but the problem with this is when you click another checkbox with input number 1 the already clicked checkbox will also become input number 1.
this is the actual code
$('input:checkbox').on('change', function () {
//getting the input number for the specified checkbox
var x = $(`#count-${this.value}`).map(function(){
return this.value
}).toArray().join("")
var positions = $('input:checkbox[name="Characters_Filter"]:checked').map(function() {
return '(.*' + this.value + `){${x}}`;
}).get().join('');
//filter in column 6, with an regex, no smart filtering, not case sensitive
table.column(6).search(positions, true, false, false).draw(false);
});
Answers
If you look at this site: https://xtreme-gacha.com/bbs/
Open the (Filter By:) this is the only site I found with what I needed @allan
Take a look at the index.js file to see how this site is doing the search:
https://xtreme-gacha.com/bbs/resources/js/index.js?v=3.5
Please provide step by step instructions to recreate the problem.
Kevin