One note--and this applies to every Javascript plugin or library:
Your examples need to be online. Without exception.
As soon as I have to download and run local examples, honestly I just completely lose interest. That may seem impatient, a snap judgment, arbitrary and irrational. It is in fact all of these but it doesn't matter.
There's no reason you can't have your demos online. It makes it super easy for anyone to check out.
So, one thing I don't quite understand: If I have jQuery on my page (which I imagine now at least 50% of websites do, though that's just a guess) why would I want to add another script that redefines a bunch of jQuery functions? If you had a jQuery compliant version, wouldn't it be smaller, faster, better?
Why do so many JS mini-libraries expect an ID or a CSS selector? Why not accept an element too, which lets you augment anything? Seriously, you're just crippling your library, and adding complexity by not accepting elements.
I'd like to see something like this for Backbone collections, e.g. it would take a query on model attributes and generate a subset of the original collection. Then any views (not just lists) tied to this subset would update automatically.
In fact I think with _.fiter() you could probably do this in a few lines.
For many people, high intensity/high contrast also causes eyestrain. There's nothing wrong or unreadable about medium contrast text, despite what the somewhat triumphalist contrastrebellion would have you believe.
Maybe it's just me, but it took me a second to figure out what I was looking at. "HTML Lists" didn't pop out at me right away as specifically meaning <ul> and <ol> for some reason. You should put the source code by your examples so people see what little they put in for the output they see, and it'll clarify (at least to someone like me) exactly what is going on here.
EDIT: I see now that your front page is an example, with source code. That wasn't obvious to me.
MIT according to the project page on Github. It's a little strange that they didn't include the license in the .js file. I guess they wanted to save a few bytes...
Also... 6.899kb is confusing. In many countries/locales(?) that would mean almost 7MB. Maybe 6.9kb should be used instead, or 6899bytes or something like that.
I only realized there were examples on the front page after visiting HN. They're completely below the fold for me (1440x900).
The examples page had a similar problem. The examples (pretty close to the fold) looked like comments. I went to read the comments, seeing if anyone had suggested live examples be put on the site.
The contact list example won't let me add contacts if I click "edit" on one row, then delete that row. The table also seems to degrade if you remove all elements.
"Documentation" and "Source" link to the same (Github) page. At least link to README.md for the documentation. Why is the "Download" link bold?
The front page has no indication of the name of this library above the fold.
Good point about the fold and the name. I added the name to the menu and maybe I will make the logo smaller.
I also added a note about that the contacts-example could contain bugs. My purpose with the example is the show the possibilities with add(), values() and remove(). There fore I have tried to minimize the amount of code (and there by some functionalities). But I will of course fix real bugs if there are any.
This looks pretty useful. I'm curious why you used class to store the "category". Wouldn't it be cleaner to store it in"data-category" or just Javascript? Or is that less browser compliant?
The reason is simply that I wanted it to be as simple as possible, but if it seems to be a common request I could add support for data-attributes! (and yes, it "works" in IE, by using getAttribute())
Is there a performant way to use this kind of JS files without loading the full database table into the frontend? I couldn't find anything in the documentation.
There is: give the list a fixed height and a scrollbar to display more. Load the first two or so pages immediately and render them, then request more right away (or as the user scrolls, if they scroll faster than you can load them). As the user scrolls, remove dom elements that are more than a page above or below the visible area to keep the number of nodes small. Obviously, cache the data (and the removed nodes) so that when the user scrolls back to the same spot you can load them again quickly.
If performance is important and you have a lot of data, this is an enormously tricky thing to get right, and perhaps impossible in a general case.
Note that fast scrolling of lots of data is a little-noticed but extremely optimized operation in the OS X and iPhone UI, and has undoubtedly received multiple man-years of attention.
I have optimized the script so that only 200 items are visible by default (change with options = { maxVisibleItemsCount: int }) this makes it possible to add large amounts (100 000+) items into the list without problems (except for sorting, thats sloooow if you have large amout of items).
But I am working on a solution for auto-loading data from callbacks or showing more items in list on the fly. But the problem is that most solutions are dependent on how the HTML/CSS around the list is implemented, which is something I want to avoid. Im thinking a lot about it, though.
Very cool script. Any support for permalinks?
<plug>
If you don't need your list to be on your site, you can always use listly for social lists/polling like this example of startup tools - http://list.ly/list/9E-tools-and-services-for-a-lean-startup
</plug>
This is more in the aggregate, but what is considered best practice when loading JS scripts in a page in terms of sum-total size?
This script (looks cool, btw) comes in at 7k. It seems very easy to me to add "7k here, another 7k there" and next thing you know your page needs to go on a diet.
Question is: what's the threshold that everyone follows?
I think more important than script bandwidth is # of requests.
As long as you combine your scripts, and use Google's APIs to load the cached version of common libraries like JQuery and JQuery UI. You could easily be using 10 of these libraries and still be wayy ahead of the curve as far as bandwidth is concerned.
-Add pagination. I don't mean dynamic/AJAXed pagination -- The entire list can still be loaded in the background (which would still make the list sorting/filtering possible).
[+] [-] cletus|14 years ago|reply
Your examples need to be online. Without exception.
As soon as I have to download and run local examples, honestly I just completely lose interest. That may seem impatient, a snap judgment, arbitrary and irrational. It is in fact all of these but it doesn't matter.
There's no reason you can't have your demos online. It makes it super easy for anyone to check out.
[+] [-] MichaelApproved|14 years ago|reply
[+] [-] ra|14 years ago|reply
[+] [-] johns|14 years ago|reply
[+] [-] thegorgon|14 years ago|reply
[+] [-] oinksoft|14 years ago|reply
[+] [-] Groxx|14 years ago|reply
[+] [-] Javve|14 years ago|reply
But one point with only allowing id i.e is consistency.
[+] [-] rgarcia|14 years ago|reply
In fact I think with _.fiter() you could probably do this in a few lines.
[+] [-] jashkenas|14 years ago|reply
[+] [-] crescentfresh|14 years ago|reply
[+] [-] rudasn|14 years ago|reply
[+] [-] latch|14 years ago|reply
and redesign your site...easily the biggest violation of my eyes ever.
[+] [-] farlington|14 years ago|reply
[+] [-] watty|14 years ago|reply
In fact, I'd say the Contrast Rebellion logo is the biggest violation of my eyes. Scrolling up and down doesn't seem right...
[+] [-] baddox|14 years ago|reply
[+] [-] sceaj|14 years ago|reply
hosted by (mt) Media Temple
[+] [-] unknown|14 years ago|reply
[deleted]
[+] [-] vinhboy|14 years ago|reply
[+] [-] dhugiaskmak|14 years ago|reply
[+] [-] josscrowcroft|14 years ago|reply
I tried [monkey game] and would have expected Monkey Island to show up.
Also, clicking 'edit' I would expect the table row being edited to be edited inline (it's confusing that the focus jumps down to the input boxes)
Potentially really useful but needs a bit of polishing I think - great work though.
[+] [-] Javve|14 years ago|reply
I may update the examples but, I want to keep them as simple as possible, just enough to show some of the possibilities with List.js
[+] [-] ak217|14 years ago|reply
[+] [-] Javve|14 years ago|reply
[+] [-] ayu|14 years ago|reply
[+] [-] orblivion|14 years ago|reply
EDIT: I see now that your front page is an example, with source code. That wasn't obvious to me.
[+] [-] Javve|14 years ago|reply
[+] [-] DanielRibeiro|14 years ago|reply
[1] http://razorjack.net/quicksand/
[+] [-] rgarcia|14 years ago|reply
[+] [-] yoda_sl|14 years ago|reply
[+] [-] jimmar|14 years ago|reply
[+] [-] rdg|14 years ago|reply
[+] [-] mofle|14 years ago|reply
[+] [-] Javve|14 years ago|reply
[+] [-] strager|14 years ago|reply
The examples page had a similar problem. The examples (pretty close to the fold) looked like comments. I went to read the comments, seeing if anyone had suggested live examples be put on the site.
The contact list example won't let me add contacts if I click "edit" on one row, then delete that row. The table also seems to degrade if you remove all elements.
"Documentation" and "Source" link to the same (Github) page. At least link to README.md for the documentation. Why is the "Download" link bold?
The front page has no indication of the name of this library above the fold.
[+] [-] Javve|14 years ago|reply
I also added a note about that the contacts-example could contain bugs. My purpose with the example is the show the possibilities with add(), values() and remove(). There fore I have tried to minimize the amount of code (and there by some functionalities). But I will of course fix real bugs if there are any.
The Documentation-link now leads to the readme!
Thanks for your input!
[+] [-] foresterh|14 years ago|reply
Overall a great script though.
[+] [-] Javve|14 years ago|reply
[+] [-] andreasklinger|14 years ago|reply
Is there a performant way to use this kind of JS files without loading the full database table into the frontend? I couldn't find anything in the documentation.
[+] [-] asolove|14 years ago|reply
If performance is important and you have a lot of data, this is an enormously tricky thing to get right, and perhaps impossible in a general case.
Note that fast scrolling of lots of data is a little-noticed but extremely optimized operation in the OS X and iPhone UI, and has undoubtedly received multiple man-years of attention.
[+] [-] Javve|14 years ago|reply
But I am working on a solution for auto-loading data from callbacks or showing more items in list on the fly. But the problem is that most solutions are dependent on how the HTML/CSS around the list is implemented, which is something I want to avoid. Im thinking a lot about it, though.
[+] [-] peterhajas|14 years ago|reply
Nice stuff!
[+] [-] shyamster|14 years ago|reply
[+] [-] jpdoctor|14 years ago|reply
[+] [-] jroseattle|14 years ago|reply
This script (looks cool, btw) comes in at 7k. It seems very easy to me to add "7k here, another 7k there" and next thing you know your page needs to go on a diet.
Question is: what's the threshold that everyone follows?
[+] [-] andrenotgiant|14 years ago|reply
As long as you combine your scripts, and use Google's APIs to load the cached version of common libraries like JQuery and JQuery UI. You could easily be using 10 of these libraries and still be wayy ahead of the curve as far as bandwidth is concerned.
[+] [-] Smudge|14 years ago|reply
-Add pagination. I don't mean dynamic/AJAXed pagination -- The entire list can still be loaded in the background (which would still make the list sorting/filtering possible).