Announcement

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

    TileGrid DVField formatCellValue question

    I have a simple example with certain formatCellValue functions for DVField. The function itself works without problems, but the fact that it is called every time mouse rollover for Tile causes the picture to reload and flicker.
    Was that how it was meant to be?

    React code
    Code:
              <TileGrid ref={this.documentsList} dataSource="documentsDS" autoFetchData="true"
                width="100%" height="100%" tileWidth="194" tileHeight="200" detailViewerProperties={{ rowHeight: 22 }}
                recordClick={this.onDocumentClick.bind(this)}
              >
                <fields>
                  <DVField name="picture" imageWidth="120" imageHeight="120" cellStyle="DVField" formatCellValue={this.pictureFormatter.bind(this)} />
                  <DVField name={CONSTANT.TITLE} />
                  <DVField name={CONSTANT.URL} escapeHTML="false" formatCellValue={this.urlFormatter.bind(this)} />
                  <DVField name={CONSTANT.LOCKED_BY} formatCellValue={this.lockedFormatter.bind(this)} />
                </fields>
              </TileGrid>
    Version SNAPSHOT_v13.1d_2024-03-07 (2024-03-07)

    This was not observed in version 12.1


    #2
    Presumably what is flickering is some images output by your formatters. The reason those would flicker is because of HTTP caching settings and/or possible browser-level developer settings (like turning off caching) - not something our framework controls.

    In particular, you need to look at Expires and Cache-Control headers. If you're unfamiliar with how these work, we'd recommend using ChatGPT to explain them.

    Comment


      #3
      Yes, indeed. The flickering was due to the fact that I had the browser DevTools panel open with the cache disabled.

      And the fact that the format Cell Value is called with mouse rollOver was it so intended?
      And is there a way to disable it?
      Last edited by Hirn; 11 Mar 2024, 17:27.

      Comment


        #4
        See redrawOnStateChange. The redraw() is what is ultimately calling your formatting logic. It's intended that you can redraw on rollover if you want, but you don't have to.

        Comment

        Working...
        X