473,569 Members | 2,700 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 _getElementsByX Path, 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 2690
On Nov 5, 10:23 am, Simon <simon.wilkin.. .@gmail.comwrot e:
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.comwrot e:
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
1620
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
4240
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 number of records. Both these numbers are known
9
1546
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
4128
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) { return -1; } else
8
5220
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 developing a web-based application, one part of which involves allowing the user the ability to page through transaction "history" information. The...
6
2244
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. ---------------------------(end of broadcast)--------------------------- TIP 5: Have you checked our extensive FAQ? ...
25
2198
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 function that will merge like elements into a chain, so that they won't have to be recompared as many times? Thanks!
10
2755
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 write such layers myself I got stuck on how to get filtered or sorted data from the data-layer. This is what I got: Objects
5
4916
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 there are, it crashes. There are currently 6 columns, and I only want 4. How do I remove the last two (discount and date)? Here is a link:...
0
7612
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7924
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8122
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7673
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7970
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5513
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3653
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1213
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
937
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.