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

Filter table with exact match

$
0
0

Hello everybody
i have this code that should filter a table

if I click on the Alex checkbox nothing happens

but if I click on Alex 2 the filter will be executed

the problem is that the code is not doing an exact search

where is the error in the code?

<script>

// start filter checkbox    2 di 2

$('input:checkbox').on('change', function () {
   //build a regex filter string with an or(|) condition
   //build a filter string with an or(|) condition
   
   var credit = $('input:checkbox[name="cred"]:checked').map(function() {
     return this.value;
   }).get().join('|');
   
   //now filter in column 2, with no regex, no smart filtering, not case sensitive
   table.column(4).search(credit, true, false, false).draw(false);
   
   //
   
</script>

Viewing all articles
Browse latest Browse all 82443

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>