473,566 Members | 2,772 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2523
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********@mat tkruse.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
2981
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 with tables in CSS or use an alternative. The first page: http://www.mi-harness.com/hof/0a0.html Is part of a frames section, with 17 such...
0
1270
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 forced to resort to tables to appease IE users (at least 95% of the readers of these pages will be using Mozilla, but among the IE users there may...
0
2688
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 form. Then I have 3 pages on a tab control ( 4 if the type of candidate validates that is is to be shown) Each page has a subform. The subforms can...
1
1551
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 sortable product listings such as shown on such sites? I am already able to get CSV into sortable (by javascript) HTML tables that do not use...
1
1190
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
7681
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 close' I think that I have read in some threads (althoug I cannot find them now) that others place such tables in a local, linked database. I could...
2
1476
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. I know really nothing about tables. I just sort of guessed on what to do this is what I came up with. <?php include('includes/corefuncs.php');...
1
16942
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 examples I found on the web. Works in IE and mozilla. http://www.imaputz.com/cssStuff/bigFourVersion.html
12
5452
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 throws an error back anyway so they can't actually save more than the limit, but, is there a way I can stop them from dropping the damn thing in the...
0
7666
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7584
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
8108
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
7644
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...
1
5484
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
5213
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
1
2083
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1201
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
925
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.