Skip to content

List.js – Adds search, sort, and filters to HTML lists, tables

listjs.com
79 pointsarnklint10 comments
On HN

Comments

Good work. Question: Is it not the 'done thing' to use data attributes to hook in js functionality nowadays instead of using class attributes? This isn't a dig, more of an intrigued to see what peoples' thoughts are on this.

When I made the first version 2 years ago I thought that classes would feel more natural to newbies, but since then have data-attributes become pretty much standard in the community.

But today it's mostly a performance thing. List.js is supposed to be very fast and handle really long lists (check out http://sindresorhus.com/bower-components/ it has 6000+ items)

Excellent example use in the wild thanks, demonstrates your point well. And good to see list.js in the list. Bower rules. http://sindresorhus.com/bower-components/#!/search/list.js

In the standard case I agree (and I hope there is an option for that). I think the use case for this library is dropping it into a soup of HTML cooked up by a non-technical user. A programmer would have a JSON list to work with from the start. Could be totally off base here though, would love to see other takes on it.

If the class names remain semantic, I don't think there is much harm using classes. The class names in the examples accurate describe the elements inner content.

Querying by class over data attributes is also usually faster.

The fuzzy search is broken. "ck" doesn't match "LeChuck", and "mal" matches "Herman Toothrot".

Nice and easy to use data binding.

Looking forward to testing this!

Do one thing and do it well.

Nice work :)

Wow! Really nice!

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.