473,324 Members | 2,214 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

sorting large data sets

Hi,

I have a table I am populating with data from a DB, and have it
sortable on the client side. When the table exceeds around 300 rows,
I start running into problems with rendering and sorting it. I
started out using Prototype to help with the sorting, but it appears
that this results in a lot of calls to _getElementsByXPath, which are
taking up a large percentage of the rendering time. I believe this
call is occurring as the DOM is being parsed.

What is the general/most accepted manner of dealing with large data
sets (I am expecting some to grow into the thousands) in a table so
that it can be sorted client side? I am thinking of building a
javascript (JSON) object containing the data, and sorting based on
this. Anybody have any thoughts on this approach, or any suggestions
for other ways to approach this?

Thanks,

Simon

Nov 5 '07 #1
2 2673
On Nov 5, 10:23 am, Simon <simon.wilkin...@gmail.comwrote:
What is the general/most accepted manner of dealing with large data
sets (I am expecting some to grow into the thousands) in a table so
that it can be sorted client side?
There are a number of things to consider and a lot of small
optimizations you can put in place to quickly do client-side table
sorting. Especially in IE, loop optimizations and other things make a
big difference.

Check out my table sorting library here:
http://www.JavascriptToolbox.com/lib/table/

And is extremely fast and has a lot of functionality that you can
enable just by putting classes on your table.

I am working on an update that will fix a few minor things and add
more, but the version that is there is working quite well for me in
several production projects.

Matt Kruse

Nov 5 '07 #2
This looks pretty promising, thanks. Are there ways to extend the
sorting? The table I am working on has other data types (buttons,
coloured divs) that I would need to sort on.

Simon
On Nov 5, 11:47 am, Matt Kruse <m...@mattkruse.comwrote:
On Nov 5, 10:23 am, Simon <simon.wilkin...@gmail.comwrote:
What is the general/most accepted manner of dealing with large data
sets (I am expecting some to grow into the thousands) in a table so
that it can be sorted client side?

There are a number of things to consider and a lot of small
optimizations you can put in place to quickly do client-side table
sorting. Especially in IE, loop optimizations and other things make a
big difference.

Check out my table sorting library here:http://www.JavascriptToolbox.com/lib/table/

And is extremely fast and has a lot of functionality that you can
enable just by putting classes on your table.

I am working on an update that will fix a few minor things and add
more, but the version that is there is working quite well for me in
several production projects.

Matt Kruse

Nov 5 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Travis Pupkin | last post by:
Hi, Can anyone point me to a good online tutorial (preferably for slow learners) about advanced handling of arrays, like re-sorting the data, etc.? Thanks.
40
by: Elijah Bailey | last post by:
I want to sort a set of records using STL's sort() function, but dont see an easy way to do it. I have a char *data; which has size mn bytes where m is size of the record and n is the...
9
by: Eric Lilja | last post by:
Hello, consider the following two functions: /* function foo() */ void foo() { float y = 0.0f; float sum = 0.0f; for(int i = 0; i < num; ++i) {
22
by: mike | last post by:
If I had a date in the format "01-Jan-05" it does not sort properly with my sort routine: function compareDate(a,b) { var date_a = new Date(a); var date_b = new Date(b); if (date_a < date_b)...
8
by: Mike | last post by:
Hello, I have a few rather urgent questions that I hope someone can help with (I need to figure this out prior to a meeting tomorrow.) First, a bit of background: The company I work for is...
6
by: Dennis Gearon | last post by:
This is what has to be eventually done:(as sybase, and probably others do it) http://www.ianywhere.com/whitepapers/unicode.html I'm not sure how that will affect LIKE and REGEX. ...
25
by: Dan Stromberg | last post by:
Hi folks. Python appears to have a good sort method, but when sorting array elements that are very large, and hence have very expensive compares, is there some sort of already-available sort...
10
by: Sjaakie | last post by:
Hi, I'm, what it turns out to be, fooling around with 3-tier design. At several websites people get really enthusiastic about using custom dataobjects instead of datasets/-tables. While trying to...
5
by: jrod11 | last post by:
hi, I found a jquery html table sorting code i have implemented. I am trying to figure out how to edit how many colums there are, but every time i remove code that I think controls how many colums...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.