Reference home > @af-utils/virtual-react > createGridItemRef
createGridItemRef() function
Creates callback ref for grid item at specified index.
Signature:
Parameters
Parameter |
Type |
Description |
---|---|---|
rowsModel | ||
rowItemIndex |
number |
row item index |
colsModel | ||
colItemIndex |
number |
column item index |
Returns
(el: HTMLElement | null) => void
callback ref
Remarks
Calls VirtualScroller.attachItem() when item is mounted and VirtualScroller.detachItem() when item is about to unmount.
createListItemRef() differences:
-
works with two models at the same time;
-
column widths are taken only from first mounted row;
-
row heights are taken only from first mounted column.