开发者

jQuery / Ajax search by particular field

开发者 https://www.devze.com 2023-02-22 14:45 出处:网络
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).

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?


Try this:

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

Working JSFiddle Example


Try being less specific in your criteria:

$('input#SearchBox').quicksearch('.test');
0

精彩评论

暂无评论...
验证码 换一张
取 消