1
Answer

Multi-column search performs search only for current page

Photo of Sanjana V

Sanjana V

7y
183
1

I am using jQuery multifilter plug-in, but the multi column search works good only for the current page, how can I use the same plug-in to search the entire data-table(from other pages as well)? Kindly help, Thanks.

Multicolumn search using jQuery plugin MultiFilter :

$(document).ready(function () {     $('.filter').multifilter()     console.log(jQuery().jquery); })
The textboxes for each column to search :
<div class='filter-container'> <input autocomplete='off' class='filter txtBox2 ' id="txtB2" name='firstname' placeholder='First Name' data-col='First Name' /> </div> <div class='filter-container'> <input autocomplete='off' class='filter txtBox3 ' id="txtB3" name='lastname' placeholder='Last Name' data-col='Last Name' /> </div> <div class='filter-container'> <input autocomplete='off' class='filter txtBox4 ' id="txtB4" name='dateofbirth' placeholder='Date of Birth' data-col='Date Of Birth' /> </div>
 

Answers (1)

0
Photo of Manikandan Murugesan
NA 20.5k 98.9k 7y
Turns out it wasn't that difficult. Here's what I modified:
And refer the following Link : http://jsfiddle.net/RgTgM/1/ 
  1. $("#search").on("keyup"function() {  
  2. var value = $(this).val();  
  3. $("table tr").each(function(index) {  
  4.     if (index !== 0) {  
  5.         $row = $(this);  
  6.   
  7.         $row.find('td').each (function() {  
  8.             var id = $(this).text();  
  9.             if (id.indexOf(value) !== 0) {  
  10.                 $row.hide();  
  11.             }  
  12.             else {  
  13.                 $row.show();  
  14.                 return false;  
  15.             }  
  16.         });    
  17.   
  18.     }  
  19. });  
  20. });