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

Discussion in 'Javascript' started by Matt Kruse, Nov 16, 2006.

  1. Matt Kruse

    Matt Kruse Guest

    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!

    --
    Matt Kruse
    http://www.JavascriptToolbox.com
    http://www.AjaxToolbox.com
    Matt Kruse, Nov 16, 2006
    #1
    1. Advertising

  2. Matt Kruse

    mick white Guest

    Re: ANN: Table Library for sort, filtering, paging, shading, rowspan/colspancorrection

    Matt Kruse wrote:

    > 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
    mick white, Nov 16, 2006
    #2
    1. Advertising

  3. Hi Matt,

    "Matt Kruse" <> writes:

    > 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!
    >
    > --
    > Matt Kruse
    > http://www.JavascriptToolbox.com
    > http://www.AjaxToolbox.com
    >
    >


    --
    Arnaud DIEDEREN
    Software Developer
    IONIC Software
    Rue de Wallonie, 18 - 4460 Grace-Hollogne - Belgium
    Tel: +32.4.3640364 - Fax: +32.4.2534737
    mailto:
    http://www.ionicsoft.com
    Arnaud Diederen, Nov 16, 2006
    #3
  4. Matt Kruse

    Matt Kruse Guest

    mick white wrote:
    > 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?

    --
    Matt Kruse
    http://www.JavascriptToolbox.com
    http://www.AjaxToolbox.com
    Matt Kruse, Nov 16, 2006
    #4
  5. Matt Kruse

    Matt Kruse Guest

    Arnaud Diederen (aundro) wrote:
    > 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.

    --
    Matt Kruse
    http://www.JavascriptToolbox.com
    http://www.AjaxToolbox.com
    Matt Kruse, Nov 16, 2006
    #5
  6. Matt Kruse

    mick white Guest

    Re: ANN: Table Library for sort, filtering, paging, shading, rowspan/colspancorrection

    Matt Kruse wrote:

    > mick white wrote:
    >
    >> 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
    mick white, Nov 17, 2006
    #6
  7. "Matt Kruse" <> writes:

    > Arnaud Diederen (aundro) wrote:
    >> 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

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


    --
    Arnaud DIEDEREN
    Software Developer
    IONIC Software
    Rue de Wallonie, 18 - 4460 Grace-Hollogne - Belgium
    Tel: +32.4.3640364 - Fax: +32.4.2534737
    mailto:
    http://www.ionicsoft.com
    Arnaud Diederen, Nov 17, 2006
    #7
  8. Matt Kruse

    RobG Guest

    mick white wrote:
    > Matt Kruse wrote:
    >
    > > mick white wrote:
    > >
    > >> 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.


    --
    Rob
    RobG, Nov 17, 2006
    #8
  9. Matt Kruse

    Matt Kruse Guest

    mick white wrote:
    > Matt Kruse wrote:
    >> 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!

    --
    Matt Kruse
    http://www.JavascriptToolbox.com
    http://www.AjaxToolbox.com
    Matt Kruse, Nov 29, 2006
    #9
  10. Matt Kruse

    mick white Guest

    Re: ANN: Table Library for sort, filtering, paging, shading, rowspan/colspancorrection

    Matt Kruse wrote:
    > mick white wrote:
    >
    >>Matt Kruse wrote:
    >>
    >>>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!
    >

    Works fine.
    Mick
    mick white, Nov 30, 2006
    #10
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Bruce W...1

    colspan and rowspan problems

    Bruce W...1, Oct 22, 2003, in forum: HTML
    Replies:
    2
    Views:
    3,272
    Jerry Perkins
    Oct 22, 2003
  2. Klaus Wertler

    Colspan and rowspan

    Klaus Wertler, Nov 25, 2003, in forum: HTML
    Replies:
    8
    Views:
    1,430
    Sid Ismail
    Nov 27, 2003
  3. Joshua Beall

    rowspan/colspan in CSS? Does it exist?

    Joshua Beall, Apr 7, 2004, in forum: HTML
    Replies:
    11
    Views:
    68,799
    Barry Pearson
    Apr 9, 2004
  4. Logix
    Replies:
    23
    Views:
    11,600
    Isofarro
    Aug 27, 2004
  5. TheBagbournes

    rowspan/colspan help

    TheBagbournes, Jan 27, 2007, in forum: HTML
    Replies:
    6
    Views:
    1,788
    Jukka K. Korpela
    Jan 28, 2007
Loading...

Share This Page