JQuery Filter not filtering all records -


i using j query filter in code search records.my records consist of employee information.there 12 pages of records.

its working fine on current page if search record on page 2nd,then not search it.i using following code search records,

 (function ($) {          $('#search').keyup(function () {              var rex = new regexp($(this).val(), 'i');             $('.searchable tr').hide();              $('.searchable tr.gradex').filter(function () {                 return rex.test($(this).text());              }).show();            })      }(jquery)); 

html structure,showing 1 record demo;

<table class="table table-striped" id="datatable-editable">      <thead>          <tr>                 <th>name</th>                 <th>dept</th>                 <th>salary</th>                 <th>date</th>                 <th style="min-width: 80px;">action</th>             </tr>      </thead>      <tbody class="searchable">          <tr class="gradex">              <td>name</td>             <td>it</td>             <td>usd 1200</td>             <td>usd 1200</td>              <td class="actions">                  <a href="#" class="hidden on-editing save-row"><i class="fa fa-save"></i></a>                  <a href="#" class="hidden on-editing cancel-row"><i class="fa fa-times"></i></a>              </td>          </tr>         </tbody>         </table> 

any appreciated.

there no way javascript if using php pagination. idea send text entered backend(not on keyup of every character, character length more three) , filtered json data backend , rebind table again.


Comments

Popular posts from this blog

java - Run spring boot application error: Cannot instantiate interface org.springframework.context.ApplicationListener -

reactjs - React router and this.props.children - how to pass state to this.props.children -

Excel VBA "Microsoft Windows Common Controls 6.0 (SP6)" Location Changes -