Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added option subTxt to search in subelement #6

Closed
wants to merge 1 commit into from

Conversation

acouillier
Copy link

I needed to search in a subelement of my li instead of simple li text
So I added an option 'subTxt' which get a selector for children of li where we search
For example, if li contains a span with .info class, you specify {subTxt: '.info'} in options in order to filter with this span content text
Useful for complex li content (but surely slower because of jQuery find() function)

I needed to search in a subelement of my li instead of simple li text
So I added an option 'subTxt' which get a selector for children of li where we search
For example, if li contains a span with .info class, you specify {subTxt: '.info'} in options in order to filter with this span content text
Useful for complex li content (but surely slower because of jQuery find() function)
@dougmays
Copy link

dougmays commented Feb 7, 2013

any advice on how to use this version on a table?

@awbush
Copy link
Owner

awbush commented Feb 7, 2013

Try selecting all the table rows, and use the subTxt option to filter on 'td:first-child'. I think something like this:

$('.search-query').fastLiveFilter('tbody tr', {subTxt: 'td:first-child'});

@dougmays
Copy link

dougmays commented Feb 7, 2013

hmm...it's kind of working....it's removing all rows..so its searching but not finding anything. For example i have Smith, Jill in my first column on the first line...and if i search for "smith" all rows go away

@dougmays
Copy link

dougmays commented Feb 7, 2013

got it working!

used this
$('.search-query').fastLiveFilter('tbody', {subTxt: 'td:first-child'});

when i searched the tr's inside the tbody

@awbush
Copy link
Owner

awbush commented Nov 3, 2013

This change has been included in #18 and should behave the same way, except using a "selector" option instead of "subTxt"

@awbush awbush closed this Nov 3, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants