0

I have it all setup and working fine - what id like to do is have it only search by one particular field in a table (td with class of test).

Im using $('input#SearchBox').quicksearch('table#tablesorter-demo tbody tr');

which searches all the fields in the table, I have tried:

$('input#SearchBox').quicksearch('table#tablesorter-demo tbody tr td.test');

but this just stops the whole search from working, ideas appreciated?

Richard Dalton
  • 35,513
  • 6
  • 73
  • 91
Sean
  • 1

2 Answers2

1

Try this:

$('input#SearchBox').quicksearch('table#tablesorter-demo tbody tr', {'selector': 'td.test'})

Working JSFiddle Example

Richard Dalton
  • 35,513
  • 6
  • 73
  • 91
  • this may be on the right track - when using the search all the fields disappear (the ones not containing the keyword should be the only ones to disappear). However previous tries nothing at all happened, just left all fields showing... – Sean Apr 07 '11 at 13:59
  • @Sean Is there definitely some cells with the class of test that contain matching data? – Richard Dalton Apr 07 '11 at 14:06
  • @Sean I have added a working jsfiddle example using that selector. – Richard Dalton Apr 07 '11 at 14:16
  • @InfernalBadger - yes there is definetly a cell with matching data of that class. However your jsfiddle examp[le does nothing for me either...im wondering if its to do with me using IE9...shal ltry another browser when i get a chance. Thanks for the help thus far. – Sean Apr 07 '11 at 15:28
  • @Sean That could be the problem. I have noticed quite a few problems with IE9 and JS. Haven't got it installed on this machine though so can't check. – Richard Dalton Apr 07 '11 at 15:35
  • @InfernalBadger - Just checked in Firefox too and unfortunately still is not working.. – Sean Apr 07 '11 at 15:53
  • @Sean My jsfiddle example works for me in firefox. As you type in the box it will grey out rows where the ID doesn't match (as that is the one i've added the test class to). – Richard Dalton Apr 07 '11 at 16:09
0

Try being less specific in your criteria:

$('input#SearchBox').quicksearch('.test');
Diodeus - James MacFarlane
  • 112,730
  • 33
  • 157
  • 176