Skip to content

scrollTopFor

scrollTopFor(rowY, rowHeight, align, viewportHeight, bodyHeight): number

Defined in: core/src/viewport/scroll.ts:153

The vertical scroll offset that shows a row at align, in body pixels (the coordinates of RowMetrics.y and Viewport.scrollTop): 'start' puts the row at the top of the body area, right below the sticky header, 'end' at its bottom, 'center' in its middle; clamped to [0, bodyHeight - viewportHeight].

number

Top of the row (RowMetrics.y).

number

Height of the row, 0 or more.

ScrollAlign

Where it lands.

number

Height of the body area visible below the sticky header, 0 or more.

number

Height of all rows (RowLayout.bodyHeight).

number

The clamped scroll offset.

RangeError for non-finite or negative sizes, or a non-finite align.