Fastest sorted html Javascript table

I've seen some Javascript examples that could be added on top of the html table to make them sorted. The problem is that everyone I've seen and tried is insanely slow.

Any suggestions or recommendations for an effective solution.

+2


source to share


7 replies


I found (just in casual use, not through any kind of intensive analysis) that the jQuery TableSorter plugin has decent performance and is quite advanced compared to any other solution.



It relies on jQuery of course, but if you were picky about footprint, you could analyze the method used by the plugin and create your own lighter implementation.

+3


source


Have you tried tablesorter (jQuery based)?

Check it out: http://tablesorter.com/docs/



It's pretty easy to use.

+3


source


If this is for a web application and you have a lot of data, it might make sense to do server side sorting using SQL or whatever ORM you use.

+2


source


The fastest sorting method I have found is to simply sort the rows in the table. If you move a cell in the DOM, the entire row will move and therefore sorted.

Here's an example of this as I don't remember the article I read about it initially. http://www.eggheadcafe.com/community/aspnet/3/10051794/try-this.aspx

+1


source


I have spent a lot of time evaluating various extended table libraries including jquery one, dojo one, YUI datatable, and GWT paging scroll table. I was dissatisfied with how any of these worked for tables with thousands of rows (and I think the search engine is a bad solution too). I have come to the conclusion that flash is the way to go with a scenario like this.

You can find a site here that provides an example of a flash table with 10,000, 100,000, and millions of rows .

There is also this site that compares the performance of javascript and flash extended table implementation.

+1


source


Perhaps Javascript is not the solution here - you could do server side sorting or consider a flex / actionscript based solution.

0


source


I used the W3 School Sort plugin and it was very slow with a 250 row table. Don't react for 5 seconds.

Switched to tablesorter.com as pointed out in answers. Works like a charm. Much, much faster. Now don't wait.

0


source







All Articles