question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

loadMoreRows not triggering for InfiniteLoader

See original GitHub issue

First off, I just want to say thank you for creating this amazing package.

For my use case, I need to use InfiniteLoader. Unfortunately, the loadMoreRows function is not triggering.

Currently, I load my table wrapped in an InfiniteLoader and AutoSizer

const ProductsContentTableIndex = ({
  headerHeight,
  headerRenderer,
  isRowLoaded,
  loadMoreRows,
  noRowsRenderer,
  overscanRowCount,
  rowCount,
  rowGetter,
  rowHeight,
  rowRenderer,
  scrollToAlignment,
  scrollToIndex,
  sort,
  sortBy,
  sortDirection,
}) => {
  return (
    <div id='AutoSizerContainer'>
      <InfiniteLoader
        isRowLoaded={isRowLoaded}
        loadMoreRows={() => console.log('yo')}
        rowCount={rowCount}
      >
        {({ onRowsRendered, registerChild }) => (
        <AutoSizer disableHeight>
          {({ height, width }) => (
            <Table
              headerHeight={headerHeight}
              height={height}
              noRowsRenderer={noRowsRenderer}
              onRowsRendered={onRowsRendered}
              overscanRowCount={overscanRowCount}
              ref={registerChild}
              rowHeight={rowHeight}
              rowCount={rowCount}
              rowGetter={rowGetter}
              scrollToAlignment={scrollToAlignment}
              scrollToIndex={scrollToIndex}
              sort={sort}
              sortBy={sortBy}
              sortDirection={sortDirection}
              width={width}
            >
              <Column
                dataKey='index'
                flexGrow={1}
                headerRenderer={headerRenderer}
                label='Index'
                width={100}
              />
              <Column
                cellRenderer={selectCellRenderer}
                dataKey='select'
                disableSort
                flexGrow={1}
                headerRenderer={headerRenderer}
                label='Select'
                width={100}
              />
              <Column
                cellRenderer={productNameCellRenderer}
                dataKey='name'
                flexGrow={1}
                headerRenderer={headerRenderer}
                label='Product Name'
                width={100}
              />
              <Column
                cellRenderer={manufacturerCellRenderer}
                dataKey='manufacturer'
                flexGrow={1}
                headerRenderer={headerRenderer}
                label='Manufacturer'
                width={100}
              />
              <Column
                cellRenderer={categoryCellRenderer}
                dataKey='category'
                flexGrow={1}
                headerRenderer={headerRenderer}
                label='Category'
                width={100}
              />
              <Column
                cellRenderer={validCellRenderer}
                dataKey='valid'
                flexGrow={1}
                headerRenderer={headerRenderer}
                label='Valid Data'
                width={100}
              />
              <Column
                cellRenderer={publishedCellRenderer}
                dataKey='published'
                disableSort
                flexGrow={1}
                headerRenderer={headerRenderer}
                label='Published'
                width={100}
              />
              <Column
                cellRenderer={optionsCellRenderer}
                dataKey='options'
                disableSort
                flexGrow={1}
                headerRenderer={headerRenderer}
                label='Options'
                width={150}
              />
            </Table>
          )}
        </AutoSizer>
        )}
      </InfiniteLoader>
    </div>
  );

This will render properly. withoutrowrenderer

When I include the rowRenderer function I created, all of the columns are rendered on top of each other.

  rowRenderer({ className, columns, index, key, style }) {
    const { products } = this.props;
    let content;

    if(!this.isRowLoaded({ index })) {
      content = 'loading...'
    } else {
      content = columns
    }

    return (
      <div
        className={className}
        key={key}
        style={style}
        role='row'
      >
        {content}
      </div>
    )
  }

Is there anyone with any more experience with this library that can offer support for this issue? Thanks so much.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
windgauchocommented, Aug 15, 2017

The same happened to me. I have resolved it setting the InfiniteLoader rowCount property to the total count of rows that I will get from the database (by executing loadMoreRows) and the Table rowCount property to the ‘real’ (not the rowCount of the InifiniteLoader) number of rows in the table.

3reactions
apuntovaninicommented, May 3, 2017

Hi @prestonbernstein, I have the same problem about loadMoreRows not triggering, since you closed the issue, do you mind sharing your solution? Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

loadMoreRows not called on load - react virtualized
The problem is that loadMoreRows is not called on load or when the component is mounted. Any time a range of rows loads,...
Read more >
InfiniteLoader stops working with WindowScroller ... - GitHub
When autoHeight is set, scrolling works but it only shows 28 items and never invokes loadMoreRows. I was not able to convert the...
Read more >
Infinite scroll behaviour to loadMore not triggered when swipe ...
Hi,. I am using the sfDataGrid with the loadMore for infinite scrolling; and this is working well, triggering the loading of more rows...
Read more >
react-virtualized InfiniteLoader/List - working example using ...
loadMoreRows is passed as a prop to InfiniteLoader (you can see that in the ... tell how many items there are without fetching...
Read more >
react-virtualized infinite loader simple example - CodeSandbox
Activating extension 'vscode.typescript-language-features' failed: Could not find bundled tsserver.js.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found