Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Draw rows before they are scrolled into the viewport

    Hi,
    When I scroll through a grid using my mousewheel I often get a several blank rows in the viewport which are then drawn with content. The data is already present on the client (so no server side request is done).

    Is there a way to tell Smartclient to draw the rows before they are scrolled into the viewport? Or some other property I can set?

    I have tried setting the drawAheadRatio/quickDrawAheadRatio to larger values (4 or 6) but does not seem to help and gives larger delays when scrolling.

    I tried this demo and it shows the same behavior (show empty rows when scrolling with the mousewheel):
    http://www.smartclient.com/index.jsp#adaptiveSort

    gr. Martin

    #2
    We can't render the whole table for a large dataset (too slow), so there will necessarily be brief blank spots at times. drawAheadRatio just lets you tweak how often you see them vs a tradeoff with slower render times.

    On modern browsers the blank space is visible so briefly as to be almost not noticeable. If you're not seeing this, you may have slow logic that is running on every cell render, such as overrides of getCellCSSText, getCellStyle, formatCellValue, etc.

    Comment


      #3
      Thanks for your very prompt response!

      What are sensible values normally for these draw ahead ratios? It seems that 4 or 6 is too high.
      Should the quick draw ahead be smaller than the normal drawaheadratio?

      gr. Martin

      Comment


        #4
        The default values are the sensible and recommended values for most use cases.

        Comment


          #5
          Okay, with us we still get very visible blank rows. What I see is that if I set the drawAheadRatio at 2 is that I need 2 clicks in the scrollbar to get blank rows. It seems that Smartclient waits for additional draws (taking into account the drawAheadRatio) until it reaches the part which has not been drawn.

          Is this a correct observation?

          I would expect smartclient to draw already after one mouse click as at that point, from the current viewport * drawAheadRatio there are undrawn rows.

          Or am I missing something?

          gr. Martin

          Comment


            #6
            Yes: what you're missing is that under your proposed behavior, every single motion of the scrollbar would require a redraw, as opposed to just when undrawn area is revealed.

            Comment


              #7
              Okay, I don't want a redraw at every scroll bar movement, just before the undrawn rows are visualized. So if I have a drawAheadRatio of 2 I would want a redraw if the user is 0.5 viewport from the undrawn rows, not when the undrawn rows are revealed (as it seems to be doing right now).

              Is there a way to force Smartclient to redraw earlier? Before the undrawn rows are revealed?

              Btw, setting scrollRedrawDelay to 0 helps in chrome, but in FF still blank rows are visualized.

              gr. Martin

              Comment


                #8
                What you're missing now is that redrawing takes a moment. If you force a redraw *before* the blank area is revealed, the user feels this as a jerk and, in general, cannot freely scroll around due to these jerks.

                Comment


                  #9
                  This has been rehashed many times on the forums. If you want a better experience, again, look at reducing the impact of your custom formatting and styling functions if any. You should leave all the default settings alone, as they already represent a very carefully chosen best possible experience given the constraints of the browser.

                  Comment


                    #10
                    I appreciate your quick and thoughtfull replies, but I won't give up yet... :-).

                    Yes, so I don't want a redraw at every scrollbar movement, only when the scrolling gets near to the unrevealed rows, but *before* the undrawn rows are revealed.

                    With the current Smartclient approach the user gets to see blank rows and feels a jerk (which is even worse as the blank rows are visible longer because of the redraw delay).

                    gr. Martin

                    Comment


                      #11
                      Still I just don't understand why smartclient starts to redraw after the blank rows are scrolled into the viewport and not before the blank rows are scrolled into the viewport...

                      In both cases the user will see a jerk but the current behavior is worse as the user will see blank rows (with a jerk, so the user has enough time to see them).

                      gr. Martin

                      Comment

                      Working...
                      X