incremental table rendering, intermediate buffer flushing

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • g pavlov

    incremental table rendering, intermediate buffer flushing

    W3C recommendations notwithstanding (see
    http://w3.org/TR/html401/appendix/no...l#notes-tables) I can't
    seem to persuade either of the leading browsers to do true incremental
    table loading. Neither responds to COL/COLGROUP tags.

    I have a very large data table which is being generated in
    J/ECMA/JavaScript dynamically. I want to give the user some top rows
    while the bottom rows are still loading. Without true incremental
    table rendering I am down to the idea of trying to flush the buffer
    halfway down the table, but I can't seem to be able to do that. Except
    for inserting a call to "alert" (see below) with every other approach
    the browser waits for the whole thing to load...

    Basically, I have something like this:

    <table>
    <thead> <!-- pre-draw the headers -->
    <tr>
    <th>Header One</th>
    <th>Header Two</th>
    </tr>
    </thead>
    <tbody id="myData"> <!-- an empty TBODY -->
    </tbody>
    </table>

    <script>
    // call a function to write 20 rows from a data array
    // the function adds rows and cells to the TBODY
    // using tbody.insertRow and tr.insertCell calls
    drawTable("myDa taArray", 0, 20);

    // what do I put here, between the two (or more) calls
    // to drawTable to make the browser flush? the only
    // thing that seems to do the trick (but is unacceptable)
    // is a message box, i.e.:
    alert("draw more?");
    // I need something that has the same effect, but requires
    // no user interaction

    //call the function again to add the rest of the data
    drawTable("myDa taFile", 21, 2000);
    </script>

    Any help much appreciated (both with my general problem of displaying
    a big HTML table in a user-friendly manner and with my immediate
    problem of forcing a flush partway down). Thank in advance!

    George
  • Vic Sowers

    #2
    Re: incremental table rendering, intermediate buffer flushing

    Instead of the linw: drawTable("myDa taFile", 21, 2000);
    try: setInterval('dr awTable("myData File", 21, 2000)',1);

    "g pavlov" <geopavlov@yaho o.com> wrote in message
    news:79d542f2.0 309180856.570d4 4c4@posting.goo gle.com...[color=blue]
    > W3C recommendations notwithstanding (see
    > http://w3.org/TR/html401/appendix/no...l#notes-tables) I can't
    > seem to persuade either of the leading browsers to do true incremental
    > table loading. Neither responds to COL/COLGROUP tags.
    >
    > I have a very large data table which is being generated in
    > J/ECMA/JavaScript dynamically. I want to give the user some top rows
    > while the bottom rows are still loading. Without true incremental
    > table rendering I am down to the idea of trying to flush the buffer
    > halfway down the table, but I can't seem to be able to do that. Except
    > for inserting a call to "alert" (see below) with every other approach
    > the browser waits for the whole thing to load...
    >
    > Basically, I have something like this:
    >
    > <table>
    > <thead> <!-- pre-draw the headers -->
    > <tr>
    > <th>Header One</th>
    > <th>Header Two</th>
    > </tr>
    > </thead>
    > <tbody id="myData"> <!-- an empty TBODY -->
    > </tbody>
    > </table>
    >
    > <script>
    > // call a function to write 20 rows from a data array
    > // the function adds rows and cells to the TBODY
    > // using tbody.insertRow and tr.insertCell calls
    > drawTable("myDa taArray", 0, 20);
    >
    > // what do I put here, between the two (or more) calls
    > // to drawTable to make the browser flush? the only
    > // thing that seems to do the trick (but is unacceptable)
    > // is a message box, i.e.:
    > alert("draw more?");
    > // I need something that has the same effect, but requires
    > // no user interaction
    >
    > //call the function again to add the rest of the data
    > drawTable("myDa taFile", 21, 2000);
    > </script>
    >
    > Any help much appreciated (both with my general problem of displaying
    > a big HTML table in a user-friendly manner and with my immediate
    > problem of forcing a flush partway down). Thank in advance!
    >
    > George[/color]


    Comment

    • Vic Sowers

      #3
      Re: incremental table rendering, intermediate buffer flushing

      Oops, I ment: setTimeout('dra wTable("myDataF ile", 21, 2000)',1);


      "Vic Sowers" <Mail@VicSowers .com> wrote in message
      news:3f69f393$0 $67773$a726171b @news.hal-pc.org...[color=blue]
      > Instead of the linw: drawTable("myDa taFile", 21, 2000);
      > try: setInterval('dr awTable("myData File", 21, 2000)',1);
      >
      > "g pavlov" <geopavlov@yaho o.com> wrote in message
      > news:79d542f2.0 309180856.570d4 4c4@posting.goo gle.com...[color=green]
      > > W3C recommendations notwithstanding (see
      > > http://w3.org/TR/html401/appendix/no...l#notes-tables) I can't
      > > seem to persuade either of the leading browsers to do true incremental
      > > table loading. Neither responds to COL/COLGROUP tags.
      > >
      > > I have a very large data table which is being generated in
      > > J/ECMA/JavaScript dynamically. I want to give the user some top rows
      > > while the bottom rows are still loading. Without true incremental
      > > table rendering I am down to the idea of trying to flush the buffer
      > > halfway down the table, but I can't seem to be able to do that. Except
      > > for inserting a call to "alert" (see below) with every other approach
      > > the browser waits for the whole thing to load...
      > >
      > > Basically, I have something like this:
      > >
      > > <table>
      > > <thead> <!-- pre-draw the headers -->
      > > <tr>
      > > <th>Header One</th>
      > > <th>Header Two</th>
      > > </tr>
      > > </thead>
      > > <tbody id="myData"> <!-- an empty TBODY -->
      > > </tbody>
      > > </table>
      > >
      > > <script>
      > > // call a function to write 20 rows from a data array
      > > // the function adds rows and cells to the TBODY
      > > // using tbody.insertRow and tr.insertCell calls
      > > drawTable("myDa taArray", 0, 20);
      > >
      > > // what do I put here, between the two (or more) calls
      > > // to drawTable to make the browser flush? the only
      > > // thing that seems to do the trick (but is unacceptable)
      > > // is a message box, i.e.:
      > > alert("draw more?");
      > > // I need something that has the same effect, but requires
      > > // no user interaction
      > >
      > > //call the function again to add the rest of the data
      > > drawTable("myDa taFile", 21, 2000);
      > > </script>
      > >
      > > Any help much appreciated (both with my general problem of displaying
      > > a big HTML table in a user-friendly manner and with my immediate
      > > problem of forcing a flush partway down). Thank in advance!
      > >
      > > George[/color]
      >
      >[/color]


      Comment

      • g pavlov

        #4
        Re: incremental table rendering, intermediate buffer flushing

        "Vic Sowers" <Mail@VicSowers .com> wrote in message news:<3f69f3ea$ 0$67771$a726171 b@news.hal-pc.org>...[color=blue]
        > Oops, I ment: setTimeout('dra wTable("myDataF ile", 21, 2000)',1);[/color]

        I have tried this. It makes no difference. The table does not draw
        incrementally.

        Were you proposing this because you know it works (in which case I
        have to check my browser versions) or because you _think_ it might
        work?

        Again, the only things that seem to flush the buffer are
        intrusive/unacceptable things like throwing an alert(), a confirm() or
        a window.showModa lDialog(). Even window.showMode lessDialog() does not
        do the trick...

        George

        Comment

        • Vic Sowers

          #5
          Re: incremental table rendering, intermediate buffer flushing


          "g pavlov" <geopavlov@yaho o.com> wrote in message
          news:79d542f2.0 309191512.40c24 d0e@posting.goo gle.com...[color=blue]
          > "Vic Sowers" <Mail@VicSowers .com> wrote in message[/color]
          news:<3f69f3ea$ 0$67771$a726171 b@news.hal-pc.org>...[color=blue][color=green]
          > > Oops, I ment: setTimeout('dra wTable("myDataF ile", 21, 2000)',1);[/color]
          >
          > I have tried this. It makes no difference. The table does not draw
          > incrementally.
          >
          > Were you proposing this because you know it works (in which case I
          > have to check my browser versions) or because you _think_ it might
          > work?
          >
          > Again, the only things that seem to flush the buffer are
          > intrusive/unacceptable things like throwing an alert(), a confirm() or
          > a window.showModa lDialog(). Even window.showMode lessDialog() does not
          > do the trick...
          >
          > George[/color]

          I run the following in IE 6.0 and the rows fill and display every second:

          <html>
          <head>
          <title>Incremen tal Row Addition</title>
          </head>

          <body>
          <table id="Incr" border="1"></table>
          <script language="JavaS cript">
          var Rows=0;
          function FillRows() {
          var row = Incr.insertRow( );
          var cell = row.insertCell( );
          cell.innerText = Rows++;
          var cell = row.insertCell( );
          cell.innerText = Math.random();
          if (Rows<10) setTimeout("Fil lRows()",1000);
          }
          FillRows();
          </script>
          </body>
          </html>

          This should work on recent versions of IE (>=4.0) but I don't know if it
          will work on NS. Probably not, at least as written. NS accesses its elements
          differently, but I think the 'setTimeout' technique might work.

          Vic


          Comment

          • g pavlov

            #6
            Re: incremental table rendering, intermediate buffer flushing

            You are right. It does work in IE for me too now. I can't reproduce
            what I was doing before when it wasn't flushing. Thanks!

            Comment

            • Joe Fawcett

              #7
              Re: incremental table rendering, intermediate buffer flushing

              "g pavlov" <geopavlov@yaho o.com> wrote in message
              news:79d542f2.0 309301231.25085 b90@posting.goo gle.com...[color=blue]
              > You are right. It does work in IE for me too now. I can't reproduce
              > what I was doing before when it wasn't flushing. Thanks![/color]
              Have you tried using setTimeout to draw each row?
              On our intranet I use ScriptX from meadroid. It's free and has a wait method
              that equals VBs doEvents call. You can call it after each row is drawn or
              each group of rows.

              --

              Joe



              Comment

              Working...