Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

175
Views
Is there a way to run a JQuery quicksearch on the current row and one row above or one row below?

I have a table with tr rows that alternate between class master and class detail, like this:

<table>
  <tr class="master">
  </tr>
  <tr class="detail">
  </tr>
  <tr class="master">
  </tr>
  <tr class="detail">
  </tr>
  <tr class="master">
  </tr>
  <tr class="detail">
  </tr>
</table>

Using the jQuery quicksearch plugin, if a search result is found in a tr "detail" row I want it to also return the previous "master" row, and if a search result is found in a tr "master" row I want it to also return the next row ("detail"), regardless of whether the search target appears in that row or not. As it is now, I search a term and I get way too many "detail" row matches without their corresponding "master" rows and as a result my table looks totally messed-up.

UPDATE: Here is more information about jQuery Quicksearch:

https://www.npmjs.com/package/jquery.quicksearch

And here is my actual code:

$js_quicksearch_call = <<<JAVASCRIPT
jQuery(document).ready(
  function() {
    jQuery( "input#tb-search" ).quicksearch(
      "table tbody tr"
    );
  }
);
JAVASCRIPT;

drupal_add_js($js_quicksearch_call, 'inline');
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!