The scroll API interface that is available in the grid [[apiRef]].

interface GridScrollApi {
    getScrollPosition: (() => GridScrollParams);
    scroll: ((params: Partial<GridScrollParams>) => void);
    scrollToIndexes: ((params: Partial<GridCellIndexCoordinates>) => boolean);
}

Hierarchy (view full)

Properties

getScrollPosition: (() => GridScrollParams)

Returns the current scroll position.

Type declaration

scroll: ((params: Partial<GridScrollParams>) => void)

Triggers the viewport to scroll to the given positions (in pixels).

Type declaration

    • (params): void
    • Parameters

      • params: Partial<GridScrollParams>

        An object containing the left or top position to scroll.

      Returns void

scrollToIndexes: ((params: Partial<GridCellIndexCoordinates>) => boolean)

Triggers the viewport to scroll to the cell at indexes given by params. Returns true if the grid had to scroll to reach the target.

Type declaration

    • (params): boolean
    • Parameters

      Returns boolean

      Returns true if the index was outside of the viewport and the grid had to scroll to reach the target.