View Full Version : An *efficient* client-side sorting script?
I have yet to find a front-end column sorter that will not completely crap out on long lists... I have some tables with rows greater than 100 and this brings client-side sorters to their knees... Any recommendations on a good, front-end table sorter?
many thanks in advance.
dep
felgall
02-08-2006, 08:14 PM
When you have that many entries in the list you probably need to break it up over several pages anyway. The best solution is to move the sort to the back-end and retrieve the entries in the order that you want them from the server.
When you have that many entries in the list you probably need to break it up over several pages anyway. The best solution is to move the sort to the back-end and retrieve the entries in the order that you want them from the server.
Yep. Probably right. Thanks.
liorean
02-08-2006, 10:24 PM
You might want to try simply making some preexisting method more effective. In general, there are two things to think of. First of all is the algorithmic complexity. In general, you want to keep the sorting algorithm from exhibiting too large growths when you increase the number of sorted items.
Second is to decrease the running time of each step. If the sorting algorithm takes X steps doing the sorting, but the browser takes a certain time per step to redraw that single change, then it will have much longer running time than the exact same algorithm performed by taking the table out of the document tree (or a copy of it, though that takes some additional time before the sorting starts) before sorting and reinserting it (or replacing it by the sorted copy) after sorting is complete.
felgall
02-09-2006, 10:47 PM
If you are retrieving data from a relational database (eg. mySQL) then the database will have built-in functionality to retrieve the wanted data in the wanted order as efficiently as possible for evenly spread data. If your data is not evenly distributed you can tell the database how it is distributed and the algorithm will adjust for the distortion.
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.