ANN: Table Library for sort, filtering, paging, shading, rowspan/colspan correction

M

Matt Kruse

Table Library (BETA):
http://www.JavascriptToolbox.com/lib/table/

I just put this up in BETA form because I am seeking some feedback and I
still need to clean up and fix the filtering code.

The library provides a very simple interface for doing the following
client-side operations:
1. Table sorting
2. Table filtering
3. Alternate row shading
4. Paging
5. Rowspan/Colspan correction (to calculateactual correct .cellIndex values
for cells)

I believe the sorting is quite fast, given its feature set and generalized
approach. It out-performs other table sorting libraries I tested it against.
The sorting does not auto-sense the data type or automatically make all the
tables on your page sortable - those are both approaches I do not like.

Full documentation, more examples, and corrected filtering will be available
soon.

I would love to hear any feedback about the speed, features, and/or code if
anyone wants to take a look.

Thanks!
 
M

mick white

Matt said:
Table Library (BETA):
http://www.JavascriptToolbox.com/lib/table/

I just put this up in BETA form because I am seeking some feedback and I
still need to clean up and fix the filtering code.

The library provides a very simple interface for doing the following
client-side operations:
1. Table sorting
2. Table filtering
3. Alternate row shading
4. Paging
5. Rowspan/Colspan correction (to calculateactual correct .cellIndex values
for cells)

I believe the sorting is quite fast, given its feature set and generalized
approach. It out-performs other table sorting libraries I tested it against.
The sorting does not auto-sense the data type or automatically make all the
tables on your page sortable - those are both approaches I do not like.

Full documentation, more examples, and corrected filtering will be available
soon.

I would love to hear any feedback about the speed, features, and/or code if
anyone wants to take a look.

Thanks!
Sorting routine fails on Safari 1.3.2, I suspect this is because of
the use of cellIndex property, which is always 0(zero) in Safari.


http://www.mickweb.com/football/aleague/profiles2005.html

I dynamically set header cells' id's, "id0", "id1", etc.

Mick
 
A

Arnaud Diederen

Hi Matt,

Matt Kruse said:
Table Library (BETA):
http://www.JavascriptToolbox.com/lib/table/

I just put this up in BETA form because I am seeking some feedback and I
still need to clean up and fix the filtering code.
[...]

your table library comes exactly when one customer asked me to add
various sorting methods on tables, so I chose to use it.

My use case is pretty simple, but still, I thought even simpler ones
might be of interest.

All in all, it was very easy to use; I have to sort at least 100 rows,
so I can't give you relevant feedback concerning the speed.

The only thing I found rather puzzling is the CSS
TableSorted[A|De]scending <TH>s mechanism.
I was wondering why, even though my CSS classes were properly defined,
it didn't assign the TableSorted[A|De]scending className to <TH>s.
Turns out it's simply because the <TH> didn't have a starting
TableSortedAscending className. ..so I gave them this className, even
though, before explicitely clicking for sorting, the table is _not_
sorted.

Although I know this will be documented, I personally think there
could be a better way to decide whether or not to toggle CSS class
names than by looking at the current className.
What do you think?


I would love to hear any feedback about the speed, features, and/or code if
anyone wants to take a look.

Hope that helps,

Arnaud



--
Arnaud DIEDEREN
Software Developer
IONIC Software
Rue de Wallonie, 18 - 4460 Grace-Hollogne - Belgium
Tel: +32.4.3640364 - Fax: +32.4.2534737
mailto:[email protected]
http://www.ionicsoft.com
 
M

Matt Kruse

mick said:
Sorting routine fails on Safari 1.3.2, I suspect this is because of
the use of cellIndex property, which is always 0(zero) in Safari.

Thanks for the info, I will look into incorprating a work-around.
There seems to be a lot wrong with Safari. Why do people use it?
 
M

Matt Kruse

Arnaud said:
The only thing I found rather puzzling is the CSS
TableSorted[A|De]scending <TH>s mechanism.
I was wondering why, even though my CSS classes were properly defined,
it didn't assign the TableSorted[A|De]scending className to <TH>s.
Turns out it's simply because the <TH> didn't have a starting
TableSortedAscending className.

Actually, the cell needs to have the "sortable" class name in order to get
the TableSortedAscending/TableSortedDescending class applied to it. This is
so if you have multiple rows in your header, you don't want every cell in
the correct cellIndex position to be marked as sorted - just the one that is
the logical header for the column. You shouldn't need to put the
TableSortedAscending class name on any cell to begin with in order for it to
work. In fact, I just tested it to verify that this was the case.
 
M

mick white

Matt said:
Thanks for the info, I will look into incorprating a work-around.
There seems to be a lot wrong with Safari. Why do people use it?
Because it comes installed on every new Apple box.
Mick
 
A

Arnaud Diederen

Matt Kruse said:
Arnaud said:
The only thing I found rather puzzling is the CSS
TableSorted[A|De]scending <TH>s mechanism.
I was wondering why, even though my CSS classes were properly defined,
it didn't assign the TableSorted[A|De]scending className to <TH>s.
Turns out it's simply because the <TH> didn't have a starting
TableSortedAscending className.

Actually, the cell needs to have the "sortable" class name in order to get
the TableSortedAscending/TableSortedDescending class applied to it. This is
so if you have multiple rows in your header, you don't want every cell in
the correct cellIndex position to be marked as sorted - just the one that is
the logical header for the column. You shouldn't need to put the
TableSortedAscending class name on any cell to begin with in order for it to
work. In fact, I just tested it to verify that this was the case.

Indeed! I guess I misread the code. Thank you for your help!

By the way, I found it really handy that the Table code 'applies' to
existing tables, rather than requiring users to build the table
'within' the Table framework. I could use it pretty quickly.


Arnaud

--
Arnaud DIEDEREN
Software Developer
IONIC Software
Rue de Wallonie, 18 - 4460 Grace-Hollogne - Belgium
Tel: +32.4.3640364 - Fax: +32.4.2534737
mailto:[email protected]
http://www.ionicsoft.com
 
R

RobG

You can can't use childNodes easily because of Gecko's #text node
issue, however you might try the cells collection, which Safari does
support properly.
Because it comes installed on every new Apple box.

Not version 1.x, all *new* boxes, and those otherwise running OS X
10.4, will be running Safari 2.x, which is considerably more standards
compliant but still has the cellIndex bug.
 
M

Matt Kruse

mick said:
Sorting routine fails on Safari 1.3.2, I suspect this is because of
the use of cellIndex property, which is always 0(zero) in Safari.

I have updated the code with a fix that I think will now support a broken
cellIndex property. Please check it out again.

I've written a getCellIndex() method that either re-writes itself to return
the .cellIndex value (if correct) or loops throught he .cells[] collection
to find the matching cell and return the index.

If this was the only problem in Safari 1.3.x, I hope that it now works
correctly. Please let me know!
 
M

mick white

Matt said:
mick said:
Sorting routine fails on Safari 1.3.2, I suspect this is because of
the use of cellIndex property, which is always 0(zero) in Safari.


I have updated the code with a fix that I think will now support a broken
cellIndex property. Please check it out again.

I've written a getCellIndex() method that either re-writes itself to return
the .cellIndex value (if correct) or loops throught he .cells[] collection
to find the matching cell and return the index.

If this was the only problem in Safari 1.3.x, I hope that it now works
correctly. Please let me know!
Works fine.
Mick
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top