HTML Table Sorting Client Side Javascript

Discussion in 'JavaScript' started by VishalVasani, Jul 24, 2008.

  1. #1
    Hello,

    Any one has any idea about good Client side Javascript for HTML Table Sorting.
     
    VishalVasani, Jul 24, 2008 IP
  2. ToddMicheau

    ToddMicheau Active Member

    Messages:
    183
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    58
    #2
    That's an interesting script I've thought a little about making myself, it would require ascending ID's on each of the tables' rows, and a psudo-bubblesort method, using getElementById. . .

    Not sure if there is a method already made to do this- it would be handy though. I think I'm going to take a try at codin' this, I'll get back to you.

    ~Todd
     
    ToddMicheau, Jul 24, 2008 IP
  3. ToddMicheau

    ToddMicheau Active Member

    Messages:
    183
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    58
    #3
    Done, it's two functions, but you just call one- usage:
    
    sortTableByColumn({Column},{TableID},{Order});
    
    sortTableByColumn(1,"testTable","asc");
    // Will arrange column 1 in the table with the id of "testTable" ascendingly.
    // This will work Both numerically (arrange 1, 2, 3, 4, 5) and alphabetically (A, B, C, D, E).
    
    // Any bugs just send me a PM. 
    
    PHP:
    Look here for the download link, a demo, and how to embed and use it:
    http://bubblecoder.com/digitalPoint/JS_Sort_Table.html

    ~Todd
     
    ToddMicheau, Jul 24, 2008 IP
  4. archart

    archart Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Here some of the interesting links i found out
    Hope this helps
     
    archart, Jul 25, 2008 IP