Announcement

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

    ListGrid unable to consistently calculate scrollable height when using getRowHeight

    If I start from this example:
    https://www.smartclient.com/smartcli...izeIncrease=10

    and use this code:
    Code:
    isc.ListGrid.create({ ID:"dsListGrid", width: "100%", height: "100%", autoFetchData: true, dataSource: "supplyItem", getRowHeight: function(record,rowNum){ if(!record || record.isFolder){ return this.cellHeight; } else { return 150; } }, canMultiGroup: true, canGroupBy: true, groupTitleField: "category", groupStartOpen: "all", showGroupSummaryInHeader: true, showGroupTitleColumn: false, groupByMaxRecords:5000, groupByField:"category", showAllRecords: false, drawAheadRatio:5, showGridSummary: true, showGroupSummary: true, });
    Then the ListGrid has problem scrolling at the bottom of the table. As the attached gif demonstrates, when I get to the bottom of the scrollbar, it just displays a white background (i.e., not the normal checkered background). The problem seems tied to my use of getRowHeight. I would use cellHeight, but then my group rows are extra tall too (which I don't want).

    What I couldn't show in the gif due to the forum's file size restrictions was that if I scroll up to the data and then back down again to the bottom, I still get the white background. Sometimes if I scroll to the bottom "carefully", the last row is at the bottom, but other times, at least in my real code, it seems like it can never find the bottom correctly.

    Is there a configuration parameter I couldn't find?

    Thanks,
    Amos.

    I'm using Chrome 63.

    #2
    There's no attached .gif and your code is difficult to read due to forgeting to use CODE tags, however, most likely you need to read the docs for listGrid.virtualScrolling.

    Let us know if this does not adequately explain what's going on and/or lead to a solution.

    Comment


      #3
      Hi spider910,

      you need to add fixedRecordHeights:false, which then consistently enables the white page at the bottom. See also virtualScrolling.

      Isomorphic:
      Using this code
      Code:
      isc.ListGrid.create({
          ID: "dsListGrid",
          width: "100%",
          height: "100%",
          autoFetchData: true,
          dataSource: "supplyItem",
          getRowHeight: function(record, rowNum) {
              if (!record || record.isFolder) {
                  return this.cellHeight;
              } else {
                  return 150;
              }
          },
          canMultiGroup: true,
          canGroupBy: true,
          groupTitleField: "category",
          groupStartOpen: "all",
          showGroupSummaryInHeader: true,
          showGroupTitleColumn: false,
          groupByMaxRecords: 5000,
          groupByField: "category",
          showAllRecords: false,
          drawAheadRatio: 5,
          showGridSummary: true,
          showGroupSummary: true,
      fixedRecordHeights: false
      });
      if you select the 1st entry after the "grouping data" window is finished and then hit the "End" key on the keyboard, a whole white page is shown. Then only scrolling once up and a few times down again with the mouse wheel shows the expected "last record on top, rest white"-design.

      Best regards
      Blama

      Comment

      Working...
      X