Table Widget for IE? Fixed header, sorting columns, etc

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Matt Kruse

    Table Widget for IE? Fixed header, sorting columns, etc

    I'm looking for the best JS/CSS solution to add functionality to tables.
    The only browser which needs to be supported is IE5.5+, but no activeX can
    be used.

    to be able to do:
    - Fixed header row
    - Data sorting (preferrably intelligently determining data type based on
    content)
    - If possible, locking the first column from scrolling

    I've seen one solution at
    http://web.tampabay.rr.com/bmerkey/e...olumn-csv.html which is
    pretty good, but it uses a DIV that scrolls and puts the table within it,
    making the header row move down as the DIV is scrolled. This works, but it's
    not as elegant and simple as I'd like.

    I wish IE would support tbody{scroll:au to} but we're not that lucky :(

    --
    Matt Kruse



  • Mick White

    #2
    Re: Table Widget for IE? Fixed header, sorting columns, etc

    Matt Kruse wrote:
    [color=blue]
    > I'm looking for the best JS/CSS solution to add functionality to tables.
    > The only browser which needs to be supported is IE5.5+, but no activeX can
    > be used.
    >
    > to be able to do:
    > - Fixed header row
    > - Data sorting (preferrably intelligently determining data type based on
    > content)
    > - If possible, locking the first column from scrolling[/color]



    Something like this?

    Mick[color=blue]
    >
    > I've seen one solution at
    > http://web.tampabay.rr.com/bmerkey/e...olumn-csv.html which is
    > pretty good, but it uses a DIV that scrolls and puts the table within it,
    > making the header row move down as the DIV is scrolled. This works, but it's
    > not as elegant and simple as I'd like.
    >
    > I wish IE would support tbody{scroll:au to} but we're not that lucky :(
    >[/color]

    Comment

    • Randy Webb

      #3
      Re: Table Widget for IE? Fixed header, sorting columns, etc

      Matt Kruse wrote:
      [color=blue]
      > I'm looking for the best JS/CSS solution to add functionality to tables.
      > The only browser which needs to be supported is IE5.5+, but no activeX can
      > be used.[/color]

      Curiosity - Why IE5.5+?
      [color=blue]
      > to be able to do:
      > - Fixed header row[/color]

      There are examples in the archives. I will try to hunt them down this
      afternoon if you cant find them.

      It used the TBODY if I remember right. It was even cross-browser :)
      [color=blue]
      > - Data sorting (preferrably intelligently determining data type based on
      > content)[/color]

      [color=blue]
      > - If possible, locking the first column from scrolling[/color]

      In IE, I think you are going to have to go to a second table, to hold
      that first column to keep it from scrolling. Or, are you referring to
      the rows?
      [color=blue]
      > I've seen one solution at
      > http://web.tampabay.rr.com/bmerkey/e...olumn-csv.html which is
      > pretty good, but it uses a DIV that scrolls and puts the table within it,
      > making the header row move down as the DIV is scrolled. This works, but it's
      > not as elegant and simple as I'd like.
      >
      > I wish IE would support tbody{scroll:au to} but we're not that lucky :(
      >[/color]


      --
      Randy
      comp.lang.javas cript FAQ - http://jibbering.com/faq

      Comment

      • Matt Kruse

        #4
        Re: Table Widget for IE? Fixed header, sorting columns, etc

        Mick White wrote:[color=blue]
        > http://mickweb.com/football/aleague/profiles.html
        > Something like this?[/color]

        For purely sorting, that works. But it doesn't do it intelligently - it
        requires a parameter to explicitly say what the data type is.

        --
        Matt Kruse



        Comment

        • Matt Kruse

          #5
          Re: Table Widget for IE? Fixed header, sorting columns, etc

          Randy Webb wrote:[color=blue]
          > Curiosity - Why IE5.5+?[/color]

          Because the web app in which I'm needing to incorporate it is IE5.5+ only,
          and already relies on many IE-specific functionalities . It's not an internet
          app.
          [color=blue][color=green]
          >> to be able to do:
          >> - Fixed header row[/color]
          > There are examples in the archives. I will try to hunt them down this
          > afternoon if you cant find them.
          > It used the TBODY if I remember right. It was even cross-browser :)[/color]

          I've had a hard time finding ones that work well. The one I referenced in my
          earlier post, as it turns out, even breaks when I put a <form> tag on the
          page. Renders it fairly useless ;)
          [color=blue][color=green]
          >> - If possible, locking the first column from scrolling[/color]
          > In IE, I think you are going to have to go to a second table, to hold
          > that first column to keep it from scrolling. Or, are you referring to
          > the rows?[/color]

          Nope, definitely column. And the example url does this also.

          --
          Matt Kruse



          Comment

          • kaeli

            #6
            Re: Table Widget for IE? Fixed header, sorting columns, etc

            In article <ch4r2n012k0@ne ws1.newsguy.com >, newsgroups@matt kruse.com
            enlightened us with...[color=blue]
            > I'm looking for the best JS/CSS solution to add functionality to tables.
            > The only browser which needs to be supported is IE5.5+, but no activeX can
            > be used.
            >[/color]

            Will this one do?



            You'd need to modify it for the first row thing.

            --
            --
            ~kaeli~
            Why did kamikaze pilots wear helmets?



            Comment

            • Richard Cornford

              #7
              Re: Table Widget for IE? Fixed header, sorting columns, etc

              Matt Kruse wrote:[color=blue]
              > I'm looking for the best JS/CSS solution to add functionality
              > to tables. The only browser which needs to be supported is
              > IE5.5+, but no activeX can be used.
              >
              > to be able to do:
              > - Fixed header row
              > - Data sorting (preferrably intelligently determining
              > data type based on content)
              > - If possible, locking the first column from scrolling
              >
              > I've seen one solution at
              > http://web.tampabay.rr.com/bmerkey/e...olumn-csv.html[/color]

              Yes, that doesn't work very well without activeX.
              [color=blue]
              > which is pretty good, but it uses a DIV that scrolls and puts
              > the table within it, making the header row move down as the
              > DIV is scrolled. This works, but it's not as elegant and
              > simple as I'd like.[/color]

              I wrote a fixed header scrolling table recently (it is not IE 5.5+
              only):-

              <URL: http://litotes.demon.co.uk/example_s...bleScroll.html >

              But trying to combine it with table sorting might get a bit involved as
              it uses two clones of the original table so that the header cells are
              the same dimensions as the corresponding rows/columns so it would
              require re-ordering the rows in two table for the sorting, and the
              re-assignment of the position reporting object for the cell that defines
              the offsets for the various tables. It could be done but it wouldn't be
              that fast on a big table.

              Your desire to have the sort criteria 'intelligently' determined is
              another of your attempts to be overly general. You will not manage to be
              that general as I think you would have no choice but examine the cell
              contents with a regular expression to see if it was a Date, number or
              whatever. You would probably have to run through an entire column when
              making that test and would still be forced to make many assumptions
              about the format of the possible cell contents.
              [color=blue]
              > I wish IE would support tbody{scroll:au to} but we're not
              > that lucky :([/color]

              The scrolling TBODY approach doesn't work that well anyway. The problem
              is that the TBODY will be as wide as the THEAD so when the TBODY
              acquires a vertical scroll bar its contents overflow the remaining space
              and a horizontal scroll bar appears. So you can scroll the TBODY
              horizontally and so stop the columns lining up with their header cells.

              Richard.


              Comment

              • Brett Merkey

                #8
                Re: Table Widget for IE? Fixed header, sorting columns, etc

                "Matt Kruse" <newsgroups@mat tkruse.com> wrote in message
                news:ch4r2n012k 0@news1.newsguy .com...[color=blue]
                > I'm looking for the best JS/CSS solution to add functionality to tables.
                > to be able to do:
                > - Fixed header row
                > - Data sorting (preferrably intelligently determining data type based on
                > content)
                > - If possible, locking the first column from scrolling
                >
                > I've seen one solution at
                > http://web.tampabay.rr.com/bmerkey/e...olumn-csv.html which[/color]
                is[color=blue]
                > pretty good, but it uses a DIV that scrolls and puts the table within it,
                > making the header row move down as the DIV is scrolled. This works, but[/color]
                it's[color=blue]
                > not as elegant and simple as I'd like.[/color]


                I believe the cited URL and this cross-browser variation


                are as elegant and simple as it gets. Our teams have used it for years in
                forms-based Web apps. Making CSS do most of that work makes all
                scripting tasks, such as sorting, selection for further operations, and
                filtering
                large tables, a whole lot easier.

                Not sure why putting a DIV around a table is a problem for you but I doubt
                if you will find a robust script that "intelligen tly" figures out the data
                type. It
                is so much easier all around to give the script that information at the
                outset.
                After all, manually or thru database population, you know the datatype at
                the outset. Why not pass on the info to the script?

                If you put together something that does all you want, please post it.

                Brett


                Comment

                • Matt Kruse

                  #9
                  Re: Table Widget for IE? Fixed header, sorting columns, etc

                  Richard Cornford wrote:[color=blue][color=green]
                  >> I've seen one solution at
                  >> http://web.tampabay.rr.com/bmerkey/e...olumn-csv.html[/color]
                  > Yes, that doesn't work very well without activeX.[/color]

                  Actually, it works fine without ActiveX. The only thing X is used for is the
                  data population. If you take that out and put in static data, it works fine,
                  and purely via CSS.
                  [color=blue]
                  > I wrote a fixed header scrolling table recently (it is not IE 5.5+
                  > only):-
                  > <URL: http://litotes.demon.co.uk/example_s...bleScroll.html >[/color]

                  Cannot find server or DNS Error
                  [color=blue]
                  > Your desire to have the sort criteria 'intelligently' determined is
                  > another of your attempts to be overly general.[/color]

                  No it's not. Don't be obtuse.
                  [color=blue]
                  > You will not manage to
                  > be that general as I think you would have no choice but examine the
                  > cell contents with a regular expression to see if it was a Date,
                  > number or whatever. You would probably have to run through an entire
                  > column when making that test and would still be forced to make many
                  > assumptions about the format of the possible cell contents.[/color]

                  Actually, I was thinking of just looking at the first 3-5 values. If they're
                  all numeric, use numeric sort. If they match \d+/\d+/\d+ then use date. Etc,
                  etc. If all else fails, fall back to alphanumeric sort. It should handle
                  most common cases.
                  [color=blue]
                  > The scrolling TBODY approach doesn't work that well anyway. The
                  > problem is that the TBODY will be as wide as the THEAD so when the
                  > TBODY acquires a vertical scroll bar its contents overflow the
                  > remaining space and a horizontal scroll bar appears.[/color]

                  overflow-x:hidden;

                  --
                  Matt Kruse



                  Comment

                  • Richard Cornford

                    #10
                    Re: Table Widget for IE? Fixed header, sorting columns, etc

                    Matt Kruse wrote:[color=blue]
                    > Richard Cornford wrote:[color=green][color=darkred]
                    >>> I've seen one solution at
                    >>> http://web.tampabay.rr.com/bmerkey/e...olumn-csv.html[/color]
                    >> Yes, that doesn't work very well without activeX.[/color]
                    >
                    > Actually, it works fine without ActiveX. The only
                    > thing X is used for is the data population. If you
                    > take that out and put in static data, it works fine,
                    > and purely via CSS.[/color]

                    Fair enough, its not much of a demonstration without the data.
                    [color=blue][color=green]
                    >> I wrote a fixed header scrolling table recently (it is not IE 5.5+
                    >> only):-
                    >> <URL: http://litotes.demon.co.uk/example_s...bleScroll.html >[/color]
                    >
                    > Cannot find server or DNS Error[/color]

                    Sorry, I forgot the www from the front:-

                    <URL: http://www.litotes.demon.co.uk/examp...bleScroll.html >
                    [color=blue][color=green]
                    >> Your desire to have the sort criteria 'intelligently' determined
                    >> is another of your attempts to be overly general.[/color]
                    >
                    > No it's not. Don't be obtuse.
                    >[color=green]
                    >> You will not manage to be
                    >> that general as I think you would have no choice but examine
                    >> the cell contents with a regular expression to see if it was
                    >> a Date, number or whatever. You would probably have to run
                    >> through an entire column when making that test and would
                    >> still be forced to make many assumptions about the
                    >> format of the possible cell contents.[/color]
                    >
                    > Actually, I was thinking of just looking at the first 3-5 values.
                    > If they're all numeric, use numeric sort. If they match
                    > \d+/\d+/\d+ then use date. Etc, etc. If all else fails,
                    > fall back to alphanumeric sort. It should handle most common
                    > cases.[/color]

                    That is quite an assumption.
                    [color=blue][color=green]
                    >> The scrolling TBODY approach doesn't work that well anyway. The
                    >> problem is that the TBODY will be as wide as the THEAD so when the
                    >> TBODY acquires a vertical scroll bar its contents overflow the
                    >> remaining space and a horizontal scroll bar appears.[/color]
                    >
                    > overflow-x:hidden;[/color]

                    And with CSS?

                    Richard.


                    Comment

                    • Harag

                      #11
                      Re: Table Widget for IE? Fixed header, sorting columns, etc

                      On Wed, 1 Sep 2004 10:49:41 -0500, "Matt Kruse"
                      <newsgroups@mat tkruse.com> wrote:
                      [color=blue]
                      >I'm looking for the best JS/CSS solution to add functionality to tables.
                      >The only browser which needs to be supported is IE5.5+, but no activeX can
                      >be used.
                      >
                      > to be able to do:
                      > - Fixed header row
                      > - Data sorting (preferrably intelligently determining data type based on
                      >content)[/color]


                      Doesn't your sorting JS routine help you?





                      HTH lol

                      Al.
                      [color=blue]
                      > - If possible, locking the first column from scrolling
                      >
                      >I've seen one solution at
                      >http://web.tampabay.rr.com/bmerkey/e...olumn-csv.html which is
                      >pretty good, but it uses a DIV that scrolls and puts the table within it,
                      >making the header row move down as the DIV is scrolled. This works, but it's
                      >not as elegant and simple as I'd like.
                      >
                      >I wish IE would support tbody{scroll:au to} but we're not that lucky :([/color]

                      Comment

                      • Matt Kruse

                        #12
                        Re: Table Widget for IE? Fixed header, sorting columns, etc

                        Harag wrote:[color=blue]
                        > Doesn't your sorting JS routine help you?
                        > http://www.mattkruse.com/javascript/sorttable/
                        > HTH lol[/color]

                        Nah, that's ancient and only around for NS4-supporters who still need
                        client-side sorting.
                        Which probably doesn't even exist as a requirement for anyone anymore, so
                        I'll go ahead and remove it when I get time...

                        --
                        Matt Kruse



                        Comment

                        • Harag

                          #13
                          Re: Table Widget for IE? Fixed header, sorting columns, etc

                          On Thu, 2 Sep 2004 09:02:50 -0500, "Matt Kruse"
                          <newsgroups@mat tkruse.com> wrote:
                          [color=blue]
                          >Harag wrote:[color=green]
                          >> Doesn't your sorting JS routine help you?
                          >> http://www.mattkruse.com/javascript/sorttable/
                          >> HTH lol[/color]
                          >
                          >Nah, that's ancient and only around for NS4-supporters who still need
                          >client-side sorting.
                          >Which probably doesn't even exist as a requirement for anyone anymore, so
                          >I'll go ahead and remove it when I get time...[/color]


                          No don't remove it... replace it :) when you find a cool sorting
                          script please list it.

                          Al.

                          Comment

                          • Dr John Stockton

                            #14
                            Re: Table Widget for IE? Fixed header, sorting columns, etc

                            JRS: In article <ch5e2501tjp@ne ws1.newsguy.com >, dated Wed, 1 Sep 2004
                            16:13:36, seen in news:comp.lang. javascript, Matt Kruse
                            <newsgroups@mat tkruse.com> posted :[color=blue]
                            >
                            >Actually, I was thinking of just looking at the first 3-5 values. If they're
                            >all numeric, use numeric sort. If they match \d+/\d+/\d+ then use date. Etc,
                            >etc.[/color]

                            \d+/\d+/\d+ may be sufficient to suggest a date; but \d+-\d+-\d+ also
                            should suggest a date. One should not disregard US Federal standards,
                            even if they match international ones.

                            But that is not sufficient information to enable a sort.

                            The field order can be YMD, DMY, or MDY; which it is may be evident on
                            closer inspection, or may remain uncertain.

                            The year may be YYYY or YY; in the latter case, it will generally need
                            to be windowed into YYYY before sorting.

                            If the field is a sensible date, it can be sorted as a string; hence it
                            does not need to be recognised.

                            BTW, not only can YYYY-MM-DD be sorted as string, but YYYY-WW-D can.

                            --
                            © John Stockton, Surrey, UK. ?@merlyn.demon. co.uk Turnpike v4.00 MIME. ©
                            Web <URL:http://www.merlyn.demo n.co.uk/> - w. FAQish topics, links, acronyms
                            PAS EXE etc : <URL:http://www.merlyn.demo n.co.uk/programs/> - see 00index.htm
                            Dates - miscdate.htm moredate.htm js-dates.htm pas-time.htm critdate.htm etc.

                            Comment

                            • Mick White

                              #15
                              Re: Table Widget for IE? Fixed header, sorting columns, etc

                              Matt Kruse wrote:
                              [color=blue]
                              > Mick White wrote:
                              >[color=green]
                              >>http://mickweb.com/football/aleague/profiles.html
                              >>Something like this?[/color]
                              >
                              >
                              > For purely sorting, that works. But it doesn't do it intelligently - it
                              > requires a parameter to explicitly say what the data type is.
                              >[/color]
                              It would be easy enough to distinguish between String and Number. Just
                              test the first entry in the column, and select the appropriate sort
                              function. You can add your own rules for dates, heights, etc.
                              Mick

                              Comment

                              Working...