The Row API interface that is available in the grid apiRef.

interface GridRowApi {
    getAllRowIds: (() => GridRowId[]);
    getRow: (<R>(id: GridRowId) => null | R);
    getRowId: (<R>(row: R) => GridRowId);
    getRowIndexRelativeToVisibleRows: ((id: GridRowId) => number);
    getRowModels: (() => Map<GridRowId, GridValidRowModel>);
    getRowNode: (<N>(id: GridRowId) => null | N);
    getRowsCount: (() => number);
    setLoading: ((loading: boolean) => void);
    setRows: ((rows: GridValidRowModel[]) => void);
    unstable_replaceRows: ((firstRowToReplace: number, newRows: GridValidRowModel[]) => void);
    updateRows: ((updates: GridRowModelUpdate[]) => void);
}

Hierarchy (view full)

Properties

getAllRowIds: (() => GridRowId[])

Gets the list of row ids. TODO rows v6: Rename or remove ?

Type declaration

getRow: (<R>(id: GridRowId) => null | R)

Gets the row data with a given id.

Type declaration

getRowId: (<R>(row: R) => GridRowId)

Gets the ID of a row given its data.

Type declaration

getRowIndexRelativeToVisibleRows: ((id: GridRowId) => number)

Gets the index of a row relative to the rows that are reachable by scroll.

Type declaration

    • (id): number
    • Parameters

      Returns number

      The index of the row.

getRowModels: (() => Map<GridRowId, GridValidRowModel>)

Gets the full set of rows as [[Map<GridRowId, GridRowModel>]].

Type declaration

getRowNode: (<N>(id: GridRowId) => null | N)

Gets the row node from the internal tree structure.

Type declaration

    • <N>(id): null | N
    • Type Parameters

      Parameters

      Returns null | N

      The tree node.

getRowsCount: (() => number)

Gets the total number of rows in the grid.

Type declaration

    • (): number
    • Returns number

      The number of rows.

setLoading: ((loading: boolean) => void)

Sets the internal loading state.

Type declaration

    • (loading): void
    • Parameters

      • loading: boolean

        If true the loading indicator will be shown over the Data Grid.

      Returns void

setRows: ((rows: GridValidRowModel[]) => void)

Sets a new set of rows.

Type declaration

unstable_replaceRows: ((firstRowToReplace: number, newRows: GridValidRowModel[]) => void)

Replace a set of rows with new rows.

Type declaration

    • (firstRowToReplace, newRows): void
    • Parameters

      • firstRowToReplace: number

        The index of the first row to be replaced.

      • newRows: GridValidRowModel[]

        The new rows.

      Returns void

updateRows: ((updates: GridRowModelUpdate[]) => void)

Allows to update, insert and delete rows.

Type declaration

    • (updates): void
    • Parameters

      Returns void