473,382 Members | 1,258 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,382 software developers and data experts.

Sortable tables with multiple pages navigation

Hi,

there are a lot of different scripts out there to sort a table with multiple
columns. However, I want to do something specific.
I have a table that is "spread" accross multiple pages. Usually, when a user
wants to change the page, what you do is compute indexes in the server and
return the modified list. But that's not what I want to do, I want to be
able to navigate through the pages AND be able to sort the columns within
the client screen.

Does anyone know of a good example of something like that ? I know it can be
done, I would have to write the entire data in the client side, and then
manipulate it with indexes and sorts. I am very much able to write such
data, but should "delete" and "add" new table Elements (in a way that is
browser compatible) or show/hide <TRelements, maybe overwrite these table
rows ?
I was wondering if this is somehow trivial so you can suggest a coding
strategy or if anyone knows a good page that displays this possibility.

Thank you
Raphas
Oct 31 '06 #1
3 2518
Raphas wrote:
[snip]
manipulate it with indexes and sorts. I am very much able to write such
data, but should "delete" and "add" new table Elements (in a way that is
browser compatible) or show/hide <TRelements, maybe overwrite these table
rows ?
I would suggest testing both approaches on your target
machines/browsers. It really should be quite easy to write simple test
cases for both to see how they perform.

(And then report back, because I'm interested in knowing how it turns
out.)

My *guess* is that:
* If you create and destroy a lot of DOM nodes, that will be slow.

* If you are changing a LOT of rows' display styles, you will find a
noticeable lag here, too. Plus, having all rows as DOM nodes may be
memory intensive (depending on data size).

* You'll get the best speed out of keeping the data as pure JS objects,
and re-using a small fixed number of row/cell elements for display,
batch changing the values in them. But this will be the most annoying
to code.

Oct 31 '06 #2
Raphas wrote:
there are a lot of different scripts out there to sort a table with
multiple columns.
I'll soon be releasing mine, which beats all the ones I've seen ;)
I have a table that is "spread" accross multiple pages. Usually, when
a user wants to change the page, what you do is compute indexes in
the server and return the modified list. But that's not what I want
to do, I want to be able to navigate through the pages AND be able to
sort the columns within the client screen.
Client-side pagination? Why? A better approach, IMO, would be to fix the
height of the tbody and let the users scroll down in the long table. Forcing
them to click to flip between pages would be annoying, IMO.

If you want to do it, though, I would suggest hiding/showing TR's. It's
pretty fast in most browsers. I've filtered 2000-row tables in under a
second by showing/hiding TR's and it works great.

So on page 1, you can show rows 0-24 and hide all the rest. When you click
on "next page" you can hide 0-24 and then show 25-49. To the user, it will
look like they are paging through results. Then hook in a function to call
to show what page you're on and you're set. Shouldn't be that hard at all,
actually!

--
Matt Kruse
http://www.JavascriptToolbox.com
http://www.AjaxToolbox.com
Oct 31 '06 #3
Hi,
Thanks for you guys answer.
I agree with you on the multiple pages, this isn't really the best UI,
although I can't change anything about that : users have to be able to click
through pages.
I'll try your approach which shouldn't be too hard you are right, but how to
I hide/show rows (<TR id="row">) ? Does this work like layer visibility ?

Raphas

you have a point, I wanted
"Matt Kruse" <ne********@mattkruse.comwrote in message
news:ei*********@news1.newsguy.com...
So on page 1, you can show rows 0-24 and hide all the rest. When you click
on "next page" you can hide 0-24 and then show 25-49. To the user, it will
look like they are paging through results. Then hook in a function to call
to show what page you're on and you're set. Shouldn't be that hard at all,
actually!

--
Matt Kruse
http://www.JavascriptToolbox.com
http://www.AjaxToolbox.com


Nov 1 '06 #4

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

Similar topics

3
by: lostinspace | last post by:
Hello, My sites were created primarily with tables as layout. :-( I have two page designs which I used frequently and hopefully somebody can provide some insight as to whether its best to remain...
0
by: Jonivar Skullerud | last post by:
I am trying to create a set of pages with a standard layout with banner and horizontal navigation bar at the top of the page. Ideally i would do this without use of tables, but it seems i will be...
0
by: misscrf | last post by:
I am currently working on a database, in 3rd normal form, which is for candidates who apply for a job with the law firm that I workd for. My issue is with good form design. I have a main...
1
by: vincemoon | last post by:
Sites such as download.com, dealtime.com, shopping.com, and tucows.com, feature impressive sortable lists of products. What software that imports CSV can be used to generate database-driven...
1
by: grandslamforce | last post by:
Big deal for me, maybe the rest of you too: http://javascript.internet.com/miscellaneous/sortable-table-with-alternating-row-colors.html
10
by: Jim Devenish | last post by:
I have a split front end/back end system. However I create a number of local tables to carry out certain operations. There is a tendency for the front end to bloat so I have set 'compact on...
2
by: Bouzy | last post by:
I have been trying to make some very basic forms. Everything I think should work once I get it on my server, but it looks like crap. I know you are supposed to use tables for an easy way to position....
1
by: since | last post by:
I figured I would post my solution to the following. Resizable column tables. Search and replace values in a table. (IE only) Scrollable tables. Sortable tables. It is based on a lot...
12
by: Daz | last post by:
Hi guys, I'm trying to make a script.aculo.us sortable list have a limited number of elements in it. Now I can check for this really easily and have a warning message, and of course the php...
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...
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...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.