title: Table row filter without Pagination
body: <p>I want to filter Table data, but I have more than hundred row so I used pagination. If i apply any filter it only filters the current page inseated of entier table.</p>
  
  <p>Html and javascript code are given below</p>
  
  <pre><code>&lt;select id='filterText' style='display:inline-block' onchange='filterText()'&gt;
  &lt;option disabled selected&gt;Select&lt;/option&gt;
  &lt;option value='Active'&gt;Active&lt;/option&gt;
  &lt;option value='Obsolete'&gt;Obsolete&lt;/option&gt;
  &lt;option value='all'&gt;All&lt;/option&gt;
  &lt;/select&gt;
  
  
  &lt;table class="table table-striped table-bordered table-hover  table-list-search" id="dataTables-example"  &gt;
  &lt;thead&gt;
  &lt;tr style="background-color:#abdcd5;"&gt;
      &lt;th align="left" class="col-xs-2"&gt;Employee ID&lt;/th&gt;
      &lt;th align="left" class="col-xs-1"&gt;Name&lt;/th&gt;
      &lt;th align="left" class="col-xs-2"&gt;Location&lt;/th&gt;
      &lt;th align="left" class="col-xs-2"&gt;Company &lt;/th&gt;
      &lt;th align="left" class="col-xs-3"&gt;Job Description&lt;/th&gt;
      &lt;th align="left" class="col-xs-1"&gt;Status&lt;/th&gt;
      &lt;th align="left" class="col-xs-1"&gt;Action&lt;/th&gt;
  &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
  
      &lt;?php employeedetails::employeelist();?&gt;
  
  &lt;/tbody&gt;
                  &lt;/table&gt;
  </code></pre>
  
  <p>Javascript</p>
  
  <pre><code>&lt;script&gt;
  function filterText() {  
      var rex = new RegExp($('#filterText').val());
      if(rex == "/all/") {
          clearFilter();
      } else {
          $('.content').hide();
          $('.content').filter(function() {
              return rex.test($(this).text());
          }).show();
      }
  }
  
  function clearFilter() {
      $('.filterText').val('');
      $('.content').show();
  }
  &lt;/script&gt;
  </code></pre>
  
  <p>Php code</p>
  
  <pre><code>  &lt;?php
  
    class employeedetails
    {
  
      //function for display details of employee
  
   static function employeelist()
  {
      $tenanPortalId = $_SESSION['PortalID'];
      $databaseConnectionObject = new DB_CONNECT();
  
     $resultForGettingDetailsOfEmployees  =   mysqli_query($databaseConnectionObject-&gt;connect(),$Query); 
  
  if(!$resultForGettingDetailsOfEmployees){
  
      die(mysqli_error($databaseConnectionObject-&gt;connect()));
  }
  
  else if($resultForGettingDetailsOfEmployees)
  {
  
  
      while($row = mysqli_fetch_array($resultForGettingDetailsOfEmployees))
      {
  
  
          $employee_ID=$row['employee_id'];
          $employee_ID_trim = str_replace($tenanPortalId."~","",$row['employee_id']);
          $employee_Name=$row['employee_name'];
          $employee_Location=$row['employee_location'];
          $employee_Status=$row['employee_Status'];
          $expenseManager=$row['expenseManager'];
          $SnactionManager=$row['SnactionManager'];
          $EmployeeLocation=$row['countryName'];
          $hireDate=$row['hireDate'];
  
          if($row['company'] == "-&gt;")
          {
              $company = "";
          }
          else
          {
              $company=$row['company'];
          }
  
          if($row['reportingLineUnit'] == "-&gt;")
          {
              $reportingLineUnit="";
          }
          else
          {
              $reportingLineUnit=$row['reportingLineUnit'];
          }
  
          $employeeType = $row['employeeType'];
          $jobdescription = $row['jobDescription'];
  
          ?&gt;
          &lt;tr class="content"&gt;
              &lt;td&gt;
  
                  &lt;a data-toggle="modal" data-target='#&lt;?php echo "$employee_ID_trim"; ?&gt;' style="cursor: pointer;"&gt; 
                      &lt;?php echo "$employee_ID";?&gt;
                  &lt;/a&gt;
  
                  &lt;?php
  
                      $msg = "";
                      if($SnactionManager == "" || $SnactionManager == "No") 
                      { 
                        $msg = "Do you want to make $employee_Name as Sanction Manager?" ;                            
                      }
                      else
                      {
                        $msg = "Do you want to remove $employee_Name as Sanction Manager?" ;
                        //echo " &lt;span&gt;&lt;img src='../assets/img/twouser.png' width='20px;' height='20px;'/&gt;&lt;/span&gt;";
                      }
  
                      echo $imgPath = ($expenseManager == "Yes") ? 
                                  (($SnactionManager == "Yes") ? " &lt;span&gt;&lt;img src='../assets/img/twouser.png' width='20px;' height='20px;' title='Project &amp; Sanction Manager'/&gt;&lt;/span&gt;" : " &lt;span&gt;&lt;img src='../assets/img/project.png' width='20px;' height='20px;' title='Project Manager'/&gt;&lt;/span&gt;" ) 
                                  : 
                                  (($SnactionManager == "Yes") ? " &lt;span&gt;&lt;img src='../assets/img/sanction.png' width='20px;' height='20px;' title='Sanction Manager'/&gt;&lt;/span&gt;" : "" ) ;
                  ?&gt;
  
  
                  &lt;!-- Modal --&gt;
                      &lt;div id='&lt;?php echo "$employee_ID_trim"; ?&gt;' class="modal fade" role="dialog"  "&gt;
                        &lt;div class="modal-dialog"&gt;
  
                          &lt;!-- Modal content--&gt;
                          &lt;div class="modal-content"&gt;
                            &lt;div class="modal-header"&gt;
                              &lt;button type="button" class="close" data-dismiss="modal"&gt;&amp;times;&lt;/button&gt;
                              &lt;h4 class="modal-title"&gt;
                                  &lt;?php echo "$employee_Name";?&gt;
                              &lt;/h4&gt;
                            &lt;/div&gt;
                            &lt;div class="modal-body"&gt;
                              &lt;div class="table-responsive"&gt;
                                &lt;table class="table table-bordered table-hover"&gt;
                                  &lt;tr style="background-color:#abdcd5;"&gt;
                                      &lt;th align="left" class="col-xs-2"&gt;Project Manager&lt;/th&gt;
                                      &lt;th align="left" class="col-xs-2"&gt;Sanction Manager&lt;/th&gt;
                                      &lt;th align="left" class="col-xs-2"&gt;Type&lt;/th&gt;     
                                      &lt;th align="left" class="col-xs-2"&gt;Reporting Line Unit &lt;/th&gt; 
                                      &lt;th align="left" class="col-xs-2"&gt;Hire Date &lt;/th&gt; 
  
                                  &lt;/tr&gt;
                                  &lt;tr&gt;
                                      &lt;td&gt;&lt;?php echo "$expenseManager";?&gt;&lt;/td&gt;
  
                                      &lt;td&gt;&lt;?php echo "$SnactionManager";?&gt;&lt;/td&gt;
  
                                      &lt;td&gt;&lt;?php echo "$employeeType";?&gt;&lt;/td&gt;
  
                                      &lt;td&gt;&lt;?php echo "$reportingLineUnit";?&gt;&lt;/td&gt;
  
                                      &lt;td&gt;&lt;?php echo date("m/d/Y", strtotime($hireDate));?&gt;&lt;/td&gt;
  
                                  &lt;/tr&gt;
  
                                &lt;/table&gt;
                              &lt;/div&gt;
                            &lt;/div&gt;
                            &lt;div class="modal-footer"&gt;
                              &lt;button type="button" class="btn btn-default" data-dismiss="modal"&gt;Close&lt;/button&gt;
                            &lt;/div&gt;
                          &lt;/div&gt;
  
                        &lt;/div&gt;
                      &lt;/div&gt;
  
              &lt;/td&gt;
              &lt;td&gt;
                  &lt;?php echo "$employee_Name"; ?&gt;
  
              &lt;/td&gt;
              &lt;td&gt;&lt;?php echo "$EmployeeLocation";?&gt;&lt;/td&gt;
  
  
              &lt;td&gt;&lt;?php echo "$company";?&gt;&lt;/td&gt;
  
              &lt;td&gt;&lt;?php echo "$jobdescription";?&gt;&lt;/td&gt;
  
  
  
              &lt;?php $color =($employee_Status=="Obsolete" ? "red" : "green") ; ?&gt;
  
  
  
  
  &lt;td style="color:&lt;?php echo $color; ?&gt; ;font-weight:bold;text-align:center;"&gt;&lt;?php echo "$employee_Status";?&gt;&lt;/td&gt;
  
              &lt;td align="center"&gt;
  
  
                  &lt;button type="button" style="background-color:#00a4a4;border-color:#00a4a4;" class="btn btn-primary btn-xs" data-toggle="modal" data-target='#&lt;?php echo "$employee_ID_trim"."SMM"; ?&gt;' style="cursor: pointer;"&gt;
                      &lt;span  class="glyphicon glyphicon-pencil"&gt;&lt;/span&gt;
                  &lt;/button&gt;
  
  
  
                  &lt;div id='&lt;?php echo "$employee_ID_trim"."SMM"; ?&gt;' class="modal fade" role="dialog"  "&gt;
                    &lt;div class="modal-dialog"&gt;
  
                      &lt;!-- Modal content--&gt;
                      &lt;div class="modal-content"&gt;
                        &lt;div class="modal-header"&gt;
                          &lt;button type="button" class="close" data-dismiss="modal"&gt;&amp;times;&lt;/button&gt;
                          &lt;h4 class="modal-title"&gt;
                              &lt;?php echo "$employee_Name";?&gt;
                          &lt;/h4&gt;
                        &lt;/div&gt;
                        &lt;div class="modal-body"&gt;
                          &lt;div class="row" style="padding-bottom:5%;"&gt;
                              &lt;?php echo $msg; ?&gt;
                          &lt;/div&gt;
                          &lt;div class="row" style="padding-bottom:3%;"&gt;
  
                              &lt;form id="eventForm"  action="../index.php" method ="POST"&gt; 
  
          &lt;input type="hidden" class="form-control" id=""  name="EmployeeId" value="&lt;?php echo "$employee_ID"; ?&gt;" /&gt;
      &lt;input type="hidden" class="form-control" id=""  name="EmployeeName" value="&lt;?php echo "$employee_Name"; ?&gt;" /&gt;
                                  &lt;?php 
                      $buttonName = "Assign";
                  if($SnactionManager == "" || $SnactionManager == "No") 
                      { 
                  ?&gt;
              &lt;input type="hidden" name="SnManager"  value="Yes"&gt;                     
                  &lt;?php
                  }
                  else
                  { 
                      $buttonName = "Remove";
                  ?&gt;
              &lt;input type="hidden" name="SnManager"  value="No"&gt;
              &lt;?php   
                  }
              ?&gt;          
  
          &lt;button type="submit" class="btn btn-primary" value="Assign Manger" name="operation"&gt; 
          &lt;span class="glyphicon glyphicon-ok" &gt;&lt;/span&gt;
                      &lt;?php echo $buttonName; ?&gt; 
          &lt;/button&gt;
  
          &lt;button type="button" class="btn btn-danger" data-dismiss="modal"&gt;
              &lt;span class="glyphicon glyphicon-remove" &gt;&lt;/span&gt;
              Cancel
              &lt;/button&gt;
  
          &lt;/form&gt; 
  
  
  &lt;/div&gt;
  &lt;/div&gt;
  
  &lt;/div&gt;
  &lt;/div&gt;
  &lt;/div&gt;  
  &lt;/td&gt;
  &lt;/tr&gt;
  
  
  &lt;?php   
  } //while
  
  } //else if
  
  } //function
  } //class
  ?&gt;
  </code></pre>