Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / HTML, CSS, Scripts / JavaScript / November 2006



Tip: Looking for answers? Try searching our database.

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

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Matt Kruse - 16 Nov 2006 05:05 GMT
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!

Signature

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

mick white - 16 Nov 2006 14:37 GMT
> Table Library (BETA):
> http://www.JavascriptToolbox.com/lib/table/
[quoted text clipped - 23 lines]
>
> 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
Matt Kruse - 16 Nov 2006 23:03 GMT
>  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?

Signature

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

mick white - 17 Nov 2006 00:21 GMT
>> 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?

 Because it comes installed on every new Apple box.
Mick
RobG - 17 Nov 2006 09:29 GMT
> >> 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.

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.

> > There seems to be a lot wrong with Safari. Why do people use it?
> >
>   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.

Signature

Rob

Matt Kruse - 29 Nov 2006 21:31 GMT
>> Table Library (BETA):
>> http://www.JavascriptToolbox.com/lib/table/
>  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!

Signature

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

mick white - 30 Nov 2006 13:05 GMT
>>>Table Library (BETA):
>>>http://www.JavascriptToolbox.com/lib/table/
[quoted text clipped - 11 lines]
> 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
Arnaud Diederen (aundro) - 16 Nov 2006 15:20 GMT
Hi Matt,

> 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

> Thanks!

Signature

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

Matt Kruse - 16 Nov 2006 23:07 GMT
> 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.

Signature

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

Arnaud Diederen (aundro) - 17 Nov 2006 08:33 GMT
>> The only thing I found rather puzzling is the CSS
>> TableSorted[A|De]scending <TH>s mechanism.
[quoted text clipped - 10 lines]
> 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

Signature

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

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.