Re:List.js – Adds search, sort, and filters to HTML lists, t...
by jops on Thursday November 28, 2013 @10:56AM
(#6815036)
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.
[ Parent
| on HN ]
Re:List.js – Adds search, sort, and filters to HTML lists, t...
by Javve on Friday November 29, 2013 @05:34AM
(#6818779)
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)
Re:List.js – Adds search, sort, and filters to HTML lists, t...
by jops on Friday November 29, 2013 @05:52AM
(#6818859)
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
Re:List.js – Adds search, sort, and filters to HTML lists, t...
by yeahbutbut on Thursday November 28, 2013 @12:13PM
(#6815391)
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.
Re:List.js – Adds search, sort, and filters to HTML lists, t...
by rpsw on Thursday November 28, 2013 @01:13PM
(#6815724)
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.