[jQuery] Re: Tablesorter advice required - row level filtering based on inputs?

2008-11-10 Thread Hector Virgen
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





[jQuery] Re: Tablesorter advice required - row level filtering based on inputs?

2008-11-09 Thread aquaone
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



[jQuery] Re: Tablesorter advice required - row level filtering based on inputs?

2008-11-08 Thread Hector Virgen
I actually just started writing a plugin to do exactly what you need. I
chose to keep it separate so that they can be used independently. Also, the
search plugin is designed to work with any group of data, not just tables.
It also works on things like unordered lists or a collection of divs.
I'll send you a link to it when it's done.

-Hector


On Fri, Nov 7, 2008 at 7:31 PM, 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