scrollToIndex, width} = this.props; const classNames = cn('ReactVirtualized__List', className); return ( <Grid {...this.props} autoContainerWidth cellRenderer={this._cellRenderer} class
onClick={() => ListRef.current.scrollToRow(index *10)}> {item} }) ) }return( <AutoSizer>{({height, width})=>(<Listref={ListRef} width={width} height={height} rowCount={list.length} rowHeight={50} rowRenderer={rowRenderer} onRowsRendered={onRowsRendered} scrollToAlignment='start'...
width} = this._getCellMeasurements(); // 缓存元素的大小 cache.set(rowIndex, columnIndex, width, height); // 通过上一篇文章的分析,可以得知 parent 是 Grid 组件 // 更新 Grid 组件的 _deferredInvalidate[Column|Row]Index,使其在挂载或更新的时候 re-render if ( parent ...
scrollToRow Number 否 确保可见的行索引。优先于scrollTop scrollTop Number 否 垂直偏移量 style Object 否 可选的自定义内联样式,附加到根Grid元素 tabIndex Number 否 可选的重写默认的标签索引。默认是0 width Nubmer 是 Grid的宽度,这个属性决定了可见的列的数量 公共方法 getOffsetForCell({alignment?: str...
在上面的代码中,scrollToRow方法使用this.listRef.scrollToRow来滚动到指定的行。 这样,就可以使用react-virtualized将ref设置为List组件了。请注意,上述代码中的data和this.rowRenderer是示例数据和渲染方法,你需要根据实际情况进行调整。 推荐的腾讯云相关产品:腾讯云云服务器(CVM)和腾讯云对象存储(COS)。 腾讯云...
index, // Indexofrow within collection isScrolling, // The List is currently being scrolled isVisible, // This row is visible within the List (eg it is not an overscanned row) style, // Style object to be applied to row (to position it) ...
function rowRenderer({ key, // Unique key within array of rows key值,唯一值 index, // Index of row within collection 索引 isScrolling, // The List is currently being scrolled 当前项是否在滚动中 isVisible, // This row is visible within the List (eg it is not an overscanned row) 当...
rowStyle Object or Function Optional custom inline style to attach to table rows. This value may be either a style object or a function with the signature ({ index: number }): Object. Note that for the header row an index of -1 is provided. scrollToAlignment String Controls the alignment...
Add scrollToRow and scrollToColumn support for ssr. (microcood - #1072) Add getTotalRowsHeight and getTotalColumnsWidth to Grid. (nihgwu - #1022) Allow top-right and bottom-left scrollbars in MultiGrid be hidden. (RaviDasari - #1040) Documentation changes Added forceUpdateGrid documentation...
rowHeight={rowHeight} headerHeight={headerHeight} height={height} rowCount={rowCount} rows={rows} onRowsRendered={this.handleRowsScroll} scrollToIndex={scrollToIndex} scrollToAlignment='start' > <Column label='Id' dataKey='id' width={100} /> ...