DeuxHuitHuit / quicksearch

A jQuery plugin for searching through DOM Elements quickly
https://www.npmjs.org/package/jquery.quicksearch
Other
135 stars 35 forks source link

Unable to specify multiple columns to search #16

Closed mattheyan closed 8 years ago

mattheyan commented 9 years ago

Hi,

I'm using the following configuration, attempting to specify a sub-set of columns to search in.

$("input[type=text]").quicksearch("table tbody tr:not(.header)", {
    selector: "td.searchable"
});

Since each row contains multiple searchable elements, the indices of the row cache and text cache do not match. This results in unexpected rows being returned.

For example:

Name Location
Bob Brazil
Joe Germany
Sara England

If both columns match the "td.searchable" selector, and I search for "B", I would get back the first and second rows, because the first and second columns (both in row 1) match the filter.

I will submit a pull request if you are not opposed to supporting this scenario.

Thanks, Bryan

nitriques commented 9 years ago

Yeah please send a PR !

Ideally, create a jsfiddle which illustrate the problem...

mattheyan commented 9 years ago

Here ya go https://jsfiddle.net/xprjxv5j/

PR coming soon.

nitriques commented 9 years ago

Ooooh I see! Yes please send a PR !! Thanks!

nitriques commented 8 years ago

Fixed in #17 Thanks!