Giter Site home page Giter Site logo

awbush / jquery-fastlivefilter Goto Github PK

View Code? Open in Web Editor NEW
122.0 122.0 58.0 9 KB

A live filter plugin for jQuery that is built for speed and ease of use.

Home Page: http://anthonybush.com/projects/jquery_fast_live_filter/

License: BSD 2-Clause "Simplified" License

JavaScript 100.00%

jquery-fastlivefilter's People

Contributors

awbush avatar claviska avatar nicholasbs avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jquery-fastlivefilter's Issues

Filter a set of tables based on text in a td of each table

My DOM is a set of tables, each representing a record. I want to filter the tables displayed based on a search for the input text in each td.title element.

<table>
  <tr></tr>
  <tr></tr>
  <tr>
    <td class="title">Lore ipsum</td>
  </tr>
</table>
<table>
  <tr></tr>
  <tr></tr>
  <tr>
    <td class="title">Foobar</td>
  </tr>
</table>
<table>
  <tr></tr>
  <tr></tr>
  <tr>
    <td class="title">Lore ipsum Foobar baz</td>
  </tr>
</table>

Looks like options for fastLiveFilter should allow that but having trouble figuring it out.

options argument isn't actually optional

The documentation suggests that the following works:

$('#search_input').fastLiveFilter('#search_list');

But it doesn't, since options will then be undefined. I'll write a quick patch to fix this now.

How to reinitialise plugin if DOM changes?

I note from the source code that the variables lis and len are cached, and the comments in the code suggest reinitialising the plugin if the DOM changes after the plugin is first initialised.

Is there a fork of this code which doesn't cache those variables?

Alternatively, how can I reinitialise the plugin if the DOM changes subsequent to the plugin initialising?

clear text button

maybe you could help me with one more thing.

I want to have a button that erases the text on the #search_input text field and returns the list to its initial state (all visible), instead of deletinf the text inserted manually.

I tried an onclick function setting the text field val to nothing, like this: $('#search_input').val(''); and $('#search_input').attr('value', '');

It clears the text but it doesn´t returns the list visible.

Can you help me ?

Accents

Hi there,

I love this plugin, but I have one request. Would it be possible to broaden the search for accented characters in foreign language?

Let me explain with one concrete example:

In Spanish, I want to look for the word "adaptation", which would translate to "adaptación". If I type "adaptación", it works as expected. Now if I type "adaptacion", .i.e. without the accent on the "a", it fails to recognize that term.

In Spanish it is (unfortunately) a common practice to omit accents when searching for something because it requires for extra keystroke, and people are lazy.

Thanks.

Filter is removing <a> tags from links

I have a table listing contact info for individuals. Part of the content is a set of links for email addresses and external URLs. When I filter the content I am show only the desired content, but all of the anchor tags have been removed. Are there any options I can use to prevent this from happening?

Search not working on Tables

i have a basic html table and i'm trying to implement search on it using this code, to just search the first column

//Search Control
$(function() {
$('.search-query').fastLiveFilter('tbody td:first-child');
});

.search-query is my input
and
tbody td:first-child is to reference the first column of TD's

search on entire "nested" html markup

Hi,
thanks awbush for this awesome plugin ;)
sorry for my bad english :(
nested-markup-filter

the search doesn't work on the "nested" html markup(view attachment) :(

it's only works if i have direct text(not a html markup) on the ".child" tag

what i have to do ??

thanks

Possibility to have more than one input (add a selectbox or something)

I wonder if it's possible to add a second field for example a dropdown.

I have a list of companies and I want to filter on categories using a dropdown and filter on keywords at the same time. I noticed that I only can work with one input. Is it possible to have more search functions in one call?

Thanks.

fading

Is ite possible to fadeIn and fadeOut the items when showing and hiding them ?

Add option to highlight the keyword(s) in the string

I have one request, that should be possible. I think it would be very useful for longer strings, when the filter would highlight or just bold or underline the keywords.

.css('background-color', 'yellow');

^ This should it be, but i don't know where i should paste that...

Many thanks in advance for your help

ps.: awesome script !

Support HTML5 search inputs

Search inputs are not fully supported because the click of the clear button does not trigger the callback … But syntactycally i think search is the corret input type for most scenarios of this plugin so they should be supported.

If tried firing on change and search event but that results in the callback firing twice per change. More robust would be using input but that has the downside of being triggered even tough there are no text changes …

Unable to work due to error

This is the error I'm getting;

Uncaught TypeError: $(...).fastLiveFilter is not a function

I have tried $ and jQuery but no success

With very large lists, the DOM updates slowly when filtering up (clearing the query).

In my case, I have a list of 8000+ elements. Filtering down works fine, but when clearing the filter (or removing most of it), the function finishes quickly but the DOM takes too long to update, often freezing the page.

A simple solution is to detach the elements before changing the display property for each and appending them afterward.

var detached_lis = lis.detach();
for (var i = 0; i < len; i++) {
  ...
}
detached_lis.appendTo(list);

Reset x button does not work in IE

When typing in the input field, then if you hit the 'x' reset button that appears within the input field, nothing happens.

Sometimes even clearing out the input field, then clicking outside the input field results still do not reset. Basically an onblur event doesn't happen. If you clear the input field and hit enter, then the results will reset.

Thanks ... other than that, good quick fast little plugin.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.