Here's a link to my 'textFilter' plugin. It should do what you need, and
works on other types of elements like lists. I hope this helps.
This is my first jQuery plugin so if you have any suggestions let me know :)
http://www.virgentech.com/js/virgentech/plugins/jquery.textfilter.js
Usage should be pretty straightforward.
$(input [expr]).textFilter(elements to search [expr], [config settings
[object]]);
Examples:
$(document).ready(function()
{
// Observes the text input with id 'find-books'
// and filters the list items found in the ul with id 'books'
$('#find-books').textFilter('ul#books li');
// Searches all td elements for a match and hides its 'tr' if not a match
// You can optionally specify an element to observe to clear the search when
clicked
$('#find-people').textFilter('table#people tbody tr td', {
container: 'tr', // used by $.parents()
clear: $('#find-people').next('input[type=button]') // clears the search
when clicked
});
// You can specify a specific td to search for by using a classname in the
CSS selector
// By default a small delay is used so large tables don't cause problems.
// You can set the delay in seconds
// You can also specify the number of characters at minimum to search for
$('#find-places').textFilter('table#places tbody tr td.city', {
container: 'tr',
clear: $('#find-places').next('input[type=button]'),
delay: 0.4, // sets delay of 0.4 seconds
min: 3 // needs at least 3 chars in search box before searching
});
});
-Hector
On Sun, Nov 9, 2008 at 10:34 PM, aquaone [EMAIL PROTECTED] wrote:
would this help?
http://www.compulsivoco.com/2008/08/tablesorter-filter-results-based-on-search-string/
On Fri, Nov 7, 2008 at 19:31, rich [EMAIL PROTECTED] wrote:
Hello.
I'm here for advice on which approach to take with this problem.
I am using the wonderful tablesorter 2 plugin (http://
tablesorter.com/).
I have a table that contains data. I'd like to provide an input field
above the table so that a user can filter rows based on a string
matched from one particular column.
Is this something I could implement as an add-on to tablesorter or am
I better off keeping this functionality altogether separate.
Hope that makes sense.
Thanks for reading
Richard