javascipt table to display and sort data?

Discussion in 'JavaScript' started by falcondriver, Feb 6, 2007.

  1. #1
    hi there,

    has someone seen a javascript function that you can fill with an array (like name, address, city etc.) and it displays the data in a table that looks and behaves like a windows application table, so when you click on the header it sorts the data, flexible cell width and so on, without to reload the whole webpage?
    hope you understand what i mean, i just dont know the exact name for this thing...
     
    falcondriver, Feb 6, 2007 IP
  2. ajsa52

    ajsa52 Well-Known Member

    Messages:
    3,426
    Likes Received:
    125
    Best Answers:
    0
    Trophy Points:
    160
    #2
    Yes, that's called AJAX.
    You fill data with XML, and generate HTML on client side with XSLTtransformations, and controlled by Javascript functions and events.
    But, it's for advanced users.
     
    ajsa52, Feb 6, 2007 IP
  3. falcondriver

    falcondriver Well-Known Member

    Messages:
    963
    Likes Received:
    47
    Best Answers:
    0
    Trophy Points:
    145
    #3
    yeah i know how it works, but do you have a link to an example code? the xml stuff etc. is easy for me, i just need this javascript table to display the data.
     
    falcondriver, Feb 6, 2007 IP
  4. ajsa52

    ajsa52 Well-Known Member

    Messages:
    3,426
    Likes Received:
    125
    Best Answers:
    0
    Trophy Points:
    160
    #4
    Well, I have on one of my own sites (but it's code is obfuscated).
    But if you know xslt, you need:
    - An XML file with your data,
    - An XSL file with your transformation code. There you need xsl: param (for sort fields), and xsl:for-each + xsl:sort (with param used).
    - The transformation output will put as column headers, your html links to javascript functions on which you'll do new transformations passing the new "sort parameters" to your XSL.
    - Also, if you like you can add more functions using another parameters. Example: A "filter" parameter to show only those fields that "match" your parameter. That filter will be used on the "select" of your xsl:for-each loop.

    Hope this help.
     
    ajsa52, Feb 6, 2007 IP