3 ms·
If the list is REALLY long you should consider sorting it from a web worker. You might also want to consider implementing windowing or using a library, that wa
by TheAceOfHearts 8y ago
If the list is REALLY long you should consider sorting it from a web worker.
You might also want to consider implementing windowing or using a library, that way you only render what's visible on-screen. However this has its own caveats, so I'd suggest considering it carefully. For example, it'll break browser search for non-visible items. If you can get away with it I'd definitely suggest sticking with a traditional <table> element.
Can we get an idea of the size of this list?
- tzs 8y agoThis was several years ago, so there is some haziness in my memory. There was an internal tool written in PHP that that put up a form for customer support people to enter information about transactions they were interested in, then queried the customer database to find matching transaction. It then output a page with the filled-in search form and a table with the results. There was no JavaScript used on that page. Just a simple form and the table. It didn't happen often, but occasionally the table could have many thousands of rows. The project to add sorting was one of those "it would be nice if we could sort this...I bet there's code on Stackoverflow that I can just grab and drop in between things I'm actually supposed to be working on today!" things.