Announcement

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

    Lazy rendering of layouts

    Hi,

    Is there a way to do lazy (as needed) rendering of layouts in a list. Each layout consists of Img, Label and other objects. And I have all the data I need on the
    client (except the img which is a url to a resource on the server). Is there something similar to an 'Adapter' class in Android in SmartGWT that will allow me
    to do lazy rendering of the layouts?

    Thanks.

    #2
    If the layout is vertical, you can use a ListGrid, hide the header with showHeader:false, and use recordComponents.

    This actually goes far beyond lazy rendering per se, since recordComponentPoolingMode:"recycle" lets you recycle components for performance, and although in this case you've stated you have all the data, the ListGrid will also let you load data on demand.

    Comment


      #3
      Thanks for your pointers. It helped me get the lazy rendering working. There is however a cosmetic issue - a scrollbar shows up for the listgrid (so now I have a scroll bar for the listgrid and one for the page). This does not look good. I have set my listgrid to a fixed height. If I set overflow to 'visible' expecting it to resize to fit the content without showing a scrollbar, it ends up rendering all the records which is not lazy rendering any more. Is there a way to get the listgrid to grow in height as the number of records increases so as not to show a scrollbar?
      Last edited by bc; 15 Apr 2016, 18:03.

      Comment


        #4
        What exactly are you expecting to happen when the ListGrid has too many records and they can't all be displayed? Something other than scrolling?

        Comment


          #5
          I am wondering if (1) I can tell the listgrid to render no more than n records at a time and (2) as I scroll to the bottom of the list (thru page scrolling and not listgrid scrolling) render the next n records and increase the height of the listgrid accordingly so as to not display a scrollbar for the listgrid (but rather just use the page level scrollbar).

          Comment


            #6
            In order for there to be a page-level scrollbar, the grid has to render everything. You want to use the grid's scrollbar, and avoid page-level scrolling.

            Just the presence of the grid, properly sized, should not be introducing page-level scrolling, but if you have other content creating this issue, you can set overflow:hidden on the element.

            Comment

            Working...
            X