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

    How to get the best performance

    I have a grid with embedded components (recycle and within) and some cells which contain multi-line texts. I want the grid to use the same rowheight for all rows. What is the best combination of properties to get the best performance?

    This question is there because my feel is that Smartclient uses some advanced logic (which can maybe time consuming) to compute the row height per row when drawing new rows. As I want the same fixed rowheight I wonder if this rowheight computation can be prevented somehow.

    I currently have these properties set:
      enforceVClipping: true,
      recordComponentHeight: 22,
      scrollRedrawDelay: 0,
      autoFitFieldWidths: true,
      autoFitWidthApproach: 'title',
      canAutoFitFields: false
    Last edited by martintaal; 12 Apr 2011, 12:28.

    For the settings you're showing, we definitely don't recommend a scrollRedrawDelay of 0, which will cause extra redraws if the user is scrolling around rapidly. enforceVClipping isn't really needed unless rows are going to have varying height content and you're putting something like an <img> into cells.

    Other than that, just make sure you set fixed widths and autoFit:false on any fields where you don't really need autofitting (this is automatic for certain types of fields - see ListGrid.autoFitFieldWidths).

    And of course make sure you aren't forcing rendering of all rows (showAllRecords for example). You can see how many rows are rendering by turning on the "gridHTML" log.


      Thanks, I had to set enforceVClipping to true because I had a text column/cell with multiple lines of text which resulted in a very heigh cell. Is there another way for me to force this cell to follow a fixed height?

      I set the scrollRedrawDelay to 0 as with the default value of 75 the user sees empty rows in the viewport when the user scrolls (even if he/she scrolls slowly). I profiled and afaics a fair amount of performance for redrawing is spend in drawing record components (with me the record component is a HLayout with 2 images and a separator, so not that complex).

      gr. Martin


        That's a valid use of enforceVClipping if you have wrapCells:false / don't want auto-sizing.

        Two images sounds like a situation where you shouldn't generally use recordComponents - just a CellFormatter would probably do.

        As far as the recordComponents - you're creating a lot of extra work by setting scrollRedrawDelay to 0.


          the two images are buttons which allow the user to edit inline or edit in a form, when editing inline the 2 images are replaced by a cancel/save button and a progress indicator when saving.

          So I could use a cellformatter but afaics I need to generate native html then, but I prefer to use the higher level sc api to create these buttons and handle their actions. Or is there a way to create canvases and return them as html from the formatCellValue?

          gr. Martin


            Two fields of type "icon" would also work for this - as far as the progressbar, it could be either not shown on a per-row basis, or attached temporarily, only when needed, via addEmbeddedComponent().