Interface GridApiCommon<GridState, GridInitialState>

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

interface GridApiCommon<GridState, GridInitialState> {
    applySorting: (() => void);
    autosizeColumns: ((options?: GridAutosizeOptions) => Promise<void>);
    deleteFilterItem: ((item: GridFilterItem) => void);
    exportDataAsCsv: ((options?: GridCsvExportOptions) => void);
    exportDataAsPrint: ((options?: GridPrintExportOptions) => void);
    exportState: ((params?: GridExportStateParams) => GridInitialState);
    forceUpdate: (() => void);
    getAllColumns: (() => GridStateColDef[]);
    getAllGroupDetails: (() => GridColumnGroupLookup);
    getAllRowIds: (() => GridRowId[]);
    getCellElement: ((id: GridRowId, field: string) => null | HTMLDivElement);
    getCellMode: ((id: GridRowId, field: string) => GridCellMode);
    getCellParams: (<R, V, F, N>(id: GridRowId, field: string) => GridCellParams<R, V, F, N>);
    getCellValue: (<V>(id: GridRowId, field: string) => V);
    getColumn: ((field: string) => GridStateColDef);
    getColumnGroupPath: ((field: string) => string[]);
    getColumnHeaderElement: ((field: string) => null | HTMLDivElement);
    getColumnHeaderParams: ((field: string) => GridColumnHeaderParams<GridValidRowModel, any, any>);
    getColumnIndex: ((field: string, useVisibleColumns?: boolean) => number);
    getColumnIndexRelativeToVisibleColumns: ((field: string) => number);
    getColumnPosition: ((field: string) => number);
    getDataAsCsv: ((options?: GridCsvExportOptions) => string);
    getFilterState: ((filterModel: GridFilterModel) => GridFilterState);
    getLocaleText: (<T>(key: T) => GridLocaleText[T]);
    getRootDimensions: (() => GridDimensions);
    getRow: (<R>(id: GridRowId) => null | R);
    getRowElement: ((id: GridRowId) => null | HTMLDivElement);
    getRowId: (<R>(row: R) => GridRowId);
    getRowIdFromRowIndex: ((index: number) => GridRowId);
    getRowIndexRelativeToVisibleRows: ((id: GridRowId) => number);
    getRowMode: ((id: GridRowId) => GridRowMode);
    getRowModels: (() => Map<GridRowId, GridValidRowModel>);
    getRowNode: (<N>(id: GridRowId) => null | N);
    getRowParams: ((id: GridRowId) => GridRowParams<any>);
    getRowsCount: (() => number);
    getRowWithUpdatedValues: ((id: GridRowId, field: string) => GridValidRowModel);
    getScrollPosition: (() => GridScrollParams);
    getSelectedRows: (() => Map<GridRowId, GridValidRowModel>);
    getSortedRowIds: (() => GridRowId[]);
    getSortedRows: (() => GridValidRowModel[]);
    getSortModel: (() => GridSortModel);
    getVisibleColumns: (() => GridStateColDef[]);
    hideColumnMenu: (() => void);
    hideFilterPanel: (() => void);
    hideHeaderFilterMenu: (() => void);
    hidePreferences: (() => void);
    ignoreDiacritics: boolean;
    isCellEditable: ((params: GridCellParams<any, unknown, unknown, GridTreeNode>) => boolean);
    isRowSelectable: ((id: GridRowId) => boolean);
    isRowSelected: ((id: GridRowId) => boolean);
    publishEvent: GridEventPublisher;
    resetRowHeights: (() => void);
    resize: (() => void);
    restoreState: ((stateToRestore: GridInitialState) => void);
    scroll: ((params: Partial<GridScrollParams>) => void);
    scrollToIndexes: ((params: Partial<GridCellIndexCoordinates>) => boolean);
    selectRow: ((id: GridRowId, isSelected?: boolean, resetSelection?: boolean) => void);
    setCellFocus: ((id: GridRowId, field: string) => void);
    setColumnHeaderFilterFocus: ((field: string, event?: MuiBaseEvent) => void);
    setColumnHeaderFocus: ((field: string, event?: MuiBaseEvent) => void);
    setColumnVisibility: ((field: string, isVisible: boolean) => void);
    setColumnVisibilityModel: ((model: GridColumnVisibilityModel) => void);
    setColumnWidth: ((field: string, width: number) => void);
    setDensity: ((density: GridDensity) => void);
    setEditCellValue: ((params: GridEditCellValueParams, event?: MuiBaseEvent) => void | Promise<boolean>);
    setFilterLogicOperator: ((operator: GridLogicOperator) => void);
    setFilterModel: ((model: GridFilterModel, reason?:
        | "upsertFilterItem"
        | "upsertFilterItems"
        | "deleteFilterItem"
        | "changeLogicOperator"
        | "restoreState"
        | "removeAllFilterItems") => void);
    setLoading: ((loading: boolean) => void);
    setPage: ((page: number) => void);
    setPageSize: ((pageSize: number) => void);
    setPaginationMeta: ((paginationMeta: GridPaginationMeta) => void);
    setPaginationModel: ((model: GridPaginationModel) => void);
    setQuickFilterValues: ((values: any[]) => void);
    setRowCount: ((rowCount: number) => void);
    setRows: ((rows: GridValidRowModel[]) => void);
    setRowSelectionModel: ((rowSelectionModel: GridRowSelectionModel) => void);
    setSortModel: ((model: GridSortModel) => void);
    showColumnMenu: ((field: string) => void);
    showFilterPanel: ((targetColumnField?: string, panelId?: string, labelId?: string) => void);
    showHeaderFilterMenu: ((field: string) => void);
    showPreferences: ((newValue: GridPreferencePanelsValue, panelId?: string, labelId?: string) => void);
    sortColumn: ((field: string, direction?: GridSortDirection, allowMultipleSorting?: boolean) => void);
    startHeaderFilterEditMode: ((field: string) => void);
    state: GridState;
    stopHeaderFilterEditMode: (() => void);
    subscribeEvent: (<E>(event: E, handler: GridEventListener<E>, options?: EventListenerOptions) => (() => void));
    toggleColumnMenu: ((field: string) => void);
    unstable_replaceRows: ((firstRowToReplace: number, newRows: GridValidRowModel[]) => void);
    unstable_setColumnVirtualization: ((enabled: boolean) => void);
    unstable_setVirtualization: ((enabled: boolean) => void);
    updateColumns: ((cols: GridColDef[]) => void);
    updateRows: ((updates: GridRowModelUpdate[]) => void);
    upsertFilterItem: ((item: GridFilterItem) => void);
    upsertFilterItems: ((items: GridFilterItem[]) => void);
    startCellEditMode(params: GridStartCellEditModeParams): void;
    startRowEditMode(params: GridStartRowEditModeParams): void;
    stopCellEditMode(params: GridStopCellEditModeParams): void;
    stopRowEditMode(params: GridStopRowEditModeParams): void;
}

Type Parameters

  • GridState extends GridStateCommunity = any
  • GridInitialState extends GridInitialStateCommunity = any

Hierarchy (view full)

Properties

applySorting autosizeColumns deleteFilterItem exportDataAsCsv exportDataAsPrint exportState forceUpdate getAllColumns getAllGroupDetails getAllRowIds getCellElement getCellMode getCellParams getCellValue getColumn getColumnGroupPath getColumnHeaderElement getColumnHeaderParams getColumnIndex getColumnIndexRelativeToVisibleColumns getColumnPosition getDataAsCsv getFilterState getLocaleText getRootDimensions getRow getRowElement getRowId getRowIdFromRowIndex getRowIndexRelativeToVisibleRows getRowMode getRowModels getRowNode getRowParams getRowsCount getRowWithUpdatedValues getScrollPosition getSelectedRows getSortedRowIds getSortedRows getSortModel getVisibleColumns hideColumnMenu hideFilterPanel hideHeaderFilterMenu hidePreferences ignoreDiacritics isCellEditable isRowSelectable isRowSelected publishEvent resetRowHeights resize restoreState scroll scrollToIndexes selectRow setCellFocus setColumnHeaderFilterFocus setColumnHeaderFocus setColumnVisibility setColumnVisibilityModel setColumnWidth setDensity setEditCellValue setFilterLogicOperator setFilterModel setLoading setPage setPageSize setPaginationMeta setPaginationModel setQuickFilterValues setRowCount setRows setRowSelectionModel setSortModel showColumnMenu showFilterPanel showHeaderFilterMenu showPreferences sortColumn startHeaderFilterEditMode state stopHeaderFilterEditMode subscribeEvent toggleColumnMenu unstable_replaceRows unstable_setColumnVirtualization unstable_setVirtualization updateColumns updateRows upsertFilterItem upsertFilterItems

Methods

Properties

applySorting: (() => void)

Applies the current sort model to the rows.

autosizeColumns: ((options?: GridAutosizeOptions) => Promise<void>)

Auto-size the columns of the grid based on the cells' content and the space available.

Type declaration

    • (options?): Promise<void>
    • Parameters

      Returns Promise<void>

      A promise that resolves when autosizing is completed

deleteFilterItem: ((item: GridFilterItem) => void)

Deletes a [[GridFilterItem]].

Type declaration

    • (item): void
    • Parameters

      Returns void

exportDataAsCsv: ((options?: GridCsvExportOptions) => void)

Downloads and exports a CSV of the grid's data.

Type declaration

    • (options?): void
    • Parameters

      Returns void

exportDataAsPrint: ((options?: GridPrintExportOptions) => void)

Print the grid's data.

Type declaration

    • (options?): void
    • Parameters

      Returns void

exportState: ((params?: GridExportStateParams) => GridInitialState)

Generates a serializable object containing the exportable parts of the DataGrid state. These values can then be passed to the initialState prop or injected using the restoreState method.

Type declaration

forceUpdate: (() => void)

Forces the grid to rerender. It's often used after a state update.

no longer needed.

getAllColumns: (() => GridStateColDef[])

Returns an array of [[GridColDef]] containing all the column definitions.

Type declaration

    • (): GridStateColDef[]
    • Returns GridStateColDef[]

      An array of [[GridStateColDef]].

getAllGroupDetails: (() => GridColumnGroupLookup)

Returns the column group lookup.

Type declaration

    • (): GridColumnGroupLookup
    • Returns GridColumnGroupLookup

      The column group lookup.

getAllRowIds: (() => GridRowId[])

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

Type declaration

getCellElement: ((id: GridRowId, field: string) => null | HTMLDivElement)

Gets the [[GridCellParams]] object that is passed as argument in events.

Type declaration

    • (id, field): null | HTMLDivElement
    • Parameters

      • id: GridRowId

        The id of the row.

      • field: string

        The column field.

      Returns null | HTMLDivElement

      The cell params.

getCellMode: ((id: GridRowId, field: string) => GridCellMode)

Gets the mode of a cell.

Type declaration

getCellParams: (<R, V, F, N>(id: GridRowId, field: string) => GridCellParams<R, V, F, N>)

Gets the [[GridCellParams]] object that is passed as argument in events.

Type declaration

getCellValue: (<V>(id: GridRowId, field: string) => V)

Gets the value of a cell at the given id and field.

Type declaration

    • <V>(id, field): V
    • Type Parameters

      • V extends unknown = any

      Parameters

      • id: GridRowId

        The id of the row.

      • field: string

        The column field.

      Returns V

      The cell value.

getColumn: ((field: string) => GridStateColDef)

Returns the [[GridColDef]] for the given field.

Type declaration

    • (field): GridStateColDef
    • Parameters

      • field: string

        The column field.

      Returns GridStateColDef

      The [[GridStateColDef]].

getColumnGroupPath: ((field: string) => string[])

Returns the id of the groups leading to the requested column. The array is ordered by increasing depth (the last element is the direct parent of the column).

Type declaration

    • (field): string[]
    • Parameters

      • field: string

        The field of of the column requested.

      Returns string[]

      The id of the groups leading to the requested column.

getColumnHeaderElement: ((field: string) => null | HTMLDivElement)

Gets the underlying DOM element for the column header with the given field.

Type declaration

    • (field): null | HTMLDivElement
    • Parameters

      • field: string

        The column field.

      Returns null | HTMLDivElement

      The DOM element or null.

getColumnHeaderParams: ((field: string) => GridColumnHeaderParams<GridValidRowModel, any, any>)

Gets the [[GridColumnHeaderParams]] object that is passed as argument in events.

Type declaration

getColumnIndex: ((field: string, useVisibleColumns?: boolean) => number)

Returns the index position of a column. By default, only the visible columns are considered. Pass false to useVisibleColumns to consider all columns.

Type declaration

    • (field, useVisibleColumns?): number
    • Parameters

      • field: string

        The column field.

      • OptionaluseVisibleColumns: boolean

        Determines if all columns or the visible ones should be considered. Default is true.

      Returns number

      The index position.

getColumnIndexRelativeToVisibleColumns: ((field: string) => number)

Gets the index of a column relative to the columns that are reachable by scroll.

Type declaration

    • (field): number
    • Parameters

      • field: string

        The column field.

      Returns number

      The index of the column.

getColumnPosition: ((field: string) => number)

Returns the left-position of a column relative to the inner border of the grid.

Type declaration

    • (field): number
    • Parameters

      • field: string

        The column field.

      Returns number

      The position in pixels.

getDataAsCsv: ((options?: GridCsvExportOptions) => string)

Returns the grid data as a CSV string. This method is used internally by exportDataAsCsv.

Type declaration

    • (options?): string
    • Parameters

      Returns string

      The data in the CSV format.

getFilterState: ((filterModel: GridFilterModel) => GridFilterState)

Returns the filter state for the given filter model without applying it to the Data Grid.

Type declaration

getLocaleText: (<T>(key: T) => GridLocaleText[T])

Returns the translation for the key.

Type declaration

getRootDimensions: (() => GridDimensions)

Returns the dimensions of the grid

Type declaration

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

Gets the row data with a given id.

Type declaration

getRowElement: ((id: GridRowId) => null | HTMLDivElement)

Gets the underlying DOM element for a row at the given id.

Type declaration

    • (id): null | HTMLDivElement
    • Parameters

      Returns null | HTMLDivElement

      The DOM element or null.

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

Gets the ID of a row given its data.

Type declaration

getRowIdFromRowIndex: ((index: number) => GridRowId)

Gets the GridRowId of a row at a specific index. The index is based on the sorted but unfiltered row list.

Type declaration

    • (index): GridRowId
    • Parameters

      • index: number

        The index of the row

      Returns GridRowId

      The GridRowId of the row.

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.

getRowMode: ((id: GridRowId) => GridRowMode)

Gets the mode of a row.

Type declaration

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.

getRowParams: ((id: GridRowId) => GridRowParams<any>)

Gets the [[GridRowParams]] object that is passed as argument in events.

Type declaration

getRowsCount: (() => number)

Gets the total number of rows in the grid.

Type declaration

    • (): number
    • Returns number

      The number of rows.

getRowWithUpdatedValues: ((id: GridRowId, field: string) => GridValidRowModel)

Returns the row with the values that were set by editing the cells. In row editing, field is ignored and all fields are considered.

Type declaration

getScrollPosition: (() => GridScrollParams)

Returns the current scroll position.

Type declaration

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

Returns an array of the selected rows.

Type declaration

getSortedRowIds: (() => GridRowId[])

Returns all row ids sorted according to the active sort model.

Type declaration

getSortedRows: (() => GridValidRowModel[])

Returns all rows sorted according to the active sort model.

Type declaration

getSortModel: (() => GridSortModel)

Returns the sort model currently applied to the grid.

Type declaration

getVisibleColumns: (() => GridStateColDef[])

Returns the currently visible columns.

Type declaration

    • (): GridStateColDef[]
    • Returns GridStateColDef[]

      An array of [[GridStateColDef]].

hideColumnMenu: (() => void)

Hides the column menu that is open.

hideFilterPanel: (() => void)

Hides the filter panel.

hideHeaderFilterMenu: (() => void)

Hides the header filter menu.

hidePreferences: (() => void)

Hides the preferences panel.

ignoreDiacritics: boolean

Returns the value of the ignoreDiacritics prop.

isCellEditable: ((params: GridCellParams<any, unknown, unknown, GridTreeNode>) => boolean)

Controls if a cell is editable.

Type declaration

    • (params): boolean
    • Parameters

      Returns boolean

      A boolean value determining if the cell is editable.

isRowSelectable: ((id: GridRowId) => boolean)

Determines if a row can be selected or not.

Type declaration

    • (id): boolean
    • Parameters

      Returns boolean

      A boolean indicating if the row can be selected.

isRowSelected: ((id: GridRowId) => boolean)

Determines if a row is selected or not.

Type declaration

    • (id): boolean
    • Parameters

      Returns boolean

      A boolean indicating if the row is selected.

publishEvent: GridEventPublisher

Emits an event.

The name of the event.

Arguments to be passed to the handlers.

The event object to pass forward.

resetRowHeights: (() => void)

Forces the recalculation of the heights of all rows.

resize: (() => void)

Triggers a resize of the component and recalculation of width and height.

restoreState: ((stateToRestore: GridInitialState) => void)

Inject the given values into the state of the DataGrid.

Type declaration

    • (stateToRestore): void
    • Parameters

      Returns void

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.

selectRow: ((id: GridRowId, isSelected?: boolean, resetSelection?: boolean) => void)

Change the selection state of a row.

Type declaration

    • (id, isSelected?, resetSelection?): void
    • Parameters

      • id: GridRowId

        The id of the row.

      • OptionalisSelected: boolean

        Pass false to unselect a row. Default is true.

      • OptionalresetSelection: boolean

        Whether to reset the already selected rows or not. Default is false.

      Returns void

setCellFocus: ((id: GridRowId, field: string) => void)

Sets the focus to the cell at the given id and field.

Type declaration

    • (id, field): void
    • Parameters

      • id: GridRowId

        The row id.

      • field: string

        The column field.

      Returns void

setColumnHeaderFilterFocus: ((field: string, event?: MuiBaseEvent) => void)

Sets the focus to the column header filter at the given field.

Type declaration

    • (field, event?): void
    • Parameters

      • field: string

        The column field.

      • Optionalevent: MuiBaseEvent

        The event that triggers the action.

      Returns void

setColumnHeaderFocus: ((field: string, event?: MuiBaseEvent) => void)

Sets the focus to the column header at the given field.

Type declaration

    • (field, event?): void
    • Parameters

      • field: string

        The column field.

      • Optionalevent: MuiBaseEvent

        The event that triggers the action.

      Returns void

setColumnVisibility: ((field: string, isVisible: boolean) => void)

Changes the visibility of the column referred by field.

Type declaration

    • (field, isVisible): void
    • Parameters

      • field: string

        The column to change visibility.

      • isVisible: boolean

        Pass true to show the column, or false to hide it. Default is false

      Returns void

setColumnVisibilityModel: ((model: GridColumnVisibilityModel) => void)

Sets the column visibility model to the one given by model.

Type declaration

setColumnWidth: ((field: string, width: number) => void)

Updates the width of a column.

Type declaration

    • (field, width): void
    • Parameters

      • field: string

        The column field.

      • width: number

        The new width.

      Returns void

setDensity: ((density: GridDensity) => void)

Sets the density of the grid.

Type declaration

    • (density): void
    • Parameters

      • density: GridDensity

        Can be: "compact", "standard", "comfortable".

      Returns void

setEditCellValue: ((params: GridEditCellValueParams, event?: MuiBaseEvent) => void | Promise<boolean>)

Sets the value of the edit cell. Commonly used inside the edit cell component.

Type declaration

    • (params, event?): void | Promise<boolean>
    • Parameters

      Returns void | Promise<boolean>

      A promise with the validation status.

setFilterLogicOperator: ((operator: GridLogicOperator) => void)

Changes the [[GridLogicOperator]] used to connect the filters.

Type declaration

    • (operator): void
    • Parameters

      Returns void

setFilterModel: ((model: GridFilterModel, reason?:
    | "upsertFilterItem"
    | "upsertFilterItems"
    | "deleteFilterItem"
    | "changeLogicOperator"
    | "restoreState"
    | "removeAllFilterItems") => void)

Sets the filter model to the one given by model.

Type declaration

    • (model, reason?): void
    • Parameters

      • model: GridFilterModel

        The new filter model.

      • Optionalreason:
            | "upsertFilterItem"
            | "upsertFilterItems"
            | "deleteFilterItem"
            | "changeLogicOperator"
            | "restoreState"
            | "removeAllFilterItems"

        The reason for the model to have changed.

      Returns void

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

setPage: ((page: number) => void)

Sets the displayed page to the value given by page.

Type declaration

    • (page): void
    • Parameters

      • page: number

        The new page number.

      Returns void

setPageSize: ((pageSize: number) => void)

Sets the number of displayed rows to the value given by pageSize.

Type declaration

    • (pageSize): void
    • Parameters

      • pageSize: number

        The new number of displayed rows.

      Returns void

setPaginationMeta: ((paginationMeta: GridPaginationMeta) => void)

Sets the paginationMeta to a new value.

Type declaration

    • (paginationMeta): void
    • Parameters

      Returns void

setPaginationModel: ((model: GridPaginationModel) => void)

Sets the paginationModel to a new value.

Type declaration

setQuickFilterValues: ((values: any[]) => void)

Set the quick filter values to the one given by values

Type declaration

    • (values): void
    • Parameters

      • values: any[]

        The list of element to quick filter

      Returns void

setRowCount: ((rowCount: number) => void)

Sets the rowCount to a new value.

Type declaration

    • (rowCount): void
    • Parameters

      • rowCount: number

        The new row count value.

      Returns void

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

Sets a new set of rows.

Type declaration

setRowSelectionModel: ((rowSelectionModel: GridRowSelectionModel) => void)

Sets the new row selection model.

⚠️ Caution: setRowSelectionModel doesn't apply the selection propagation automatically. Pass model returned by API method getPropagatedRowSelectionModel instead to apply the selection propagation.

Type declaration

    • (rowSelectionModel): void
    • Parameters

      Returns void

setSortModel: ((model: GridSortModel) => void)

Updates the sort model and triggers the sorting of rows.

Type declaration

    • (model): void
    • Parameters

      Returns void

showColumnMenu: ((field: string) => void)

Display the column menu under the field column.

Type declaration

    • (field): void
    • Parameters

      • field: string

        The column to display the menu.

      Returns void

showFilterPanel: ((targetColumnField?: string, panelId?: string, labelId?: string) => void)

Shows the filter panel. If targetColumnField is given, a filter for this field is also added.

Type declaration

    • (targetColumnField?, panelId?, labelId?): void
    • Parameters

      • OptionaltargetColumnField: string

        The column field to add a filter.

      • OptionalpanelId: string

        The unique panel id

      • OptionallabelId: string

        The unique button id

      Returns void

showHeaderFilterMenu: ((field: string) => void)

Opens the header filter menu for the given field.

Type declaration

    • (field): void
    • Parameters

      • field: string

        The field of the header filter to open menu for.

      Returns void

showPreferences: ((newValue: GridPreferencePanelsValue, panelId?: string, labelId?: string) => void)

Displays the preferences panel. The newValue argument controls the content of the panel.

Type declaration

    • (newValue, panelId?, labelId?): void
    • Parameters

      • newValue: GridPreferencePanelsValue

        The panel to open. Use "filters" or "columns".

      • OptionalpanelId: string

        The unique panel id

      • OptionallabelId: string

        The unique button id

      Returns void

sortColumn: ((field: string, direction?: GridSortDirection, allowMultipleSorting?: boolean) => void)

Sorts a column.

Type declaration

    • (field, direction?, allowMultipleSorting?): void
    • Parameters

      • field: string

        The field identifier of the column to be sorted.

      • Optionaldirection: GridSortDirection

        The direction to be sorted. By default, the next in the sortingOrder prop.

      • OptionalallowMultipleSorting: boolean

        Whether to keep the existing [[GridSortItem]]. Default is false.

      Returns void

startHeaderFilterEditMode: ((field: string) => void)

Puts the cell corresponding to the given row id and field into edit mode.

Type declaration

    • (field): void
    • Parameters

      • field: string

        The field of the header filter to put in edit mode.

      Returns void

state: GridState

Property that contains the whole state of the grid.

stopHeaderFilterEditMode: (() => void)

Stops the edit mode for the current field.

subscribeEvent: (<E>(event: E, handler: GridEventListener<E>, options?: EventListenerOptions) => (() => void))

Registers a handler for an event.

Type declaration

    • <E>(event, handler, options?): (() => void)
    • Type Parameters

      • E extends keyof GridEventLookup

      Parameters

      • event: E

        The name of the event.

      • handler: GridEventListener<E>

        The handler to be called.

      • Optionaloptions: EventListenerOptions

        Additional options for this listener.

      Returns (() => void)

      A function to unsubscribe from this event.

        • (): void
        • Returns void

toggleColumnMenu: ((field: string) => void)

Toggles the column menu under the field column.

Type declaration

    • (field): void
    • Parameters

      • field: string

        The field name to toggle the column menu.

      Returns void

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

unstable_setColumnVirtualization: ((enabled: boolean) => void)

Enable/disable column virtualization.

Type declaration

    • (enabled): void
    • Parameters

      • enabled: boolean

        The enabled value for column virtualization

      Returns void

unstable_setVirtualization: ((enabled: boolean) => void)

Enable/disable virtualization.

Type declaration

    • (enabled): void
    • Parameters

      • enabled: boolean

        The enabled value for virtualization

      Returns void

updateColumns: ((cols: GridColDef[]) => void)

Updates the definition of multiple columns at the same time.

Type declaration

    • (cols): void
    • Parameters

      • cols: GridColDef[]

        The new column [[GridColDef]] objects.

      Returns void

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

Allows to update, insert and delete rows.

Type declaration

    • (updates): void
    • Parameters

      Returns void

upsertFilterItem: ((item: GridFilterItem) => void)

Updates or inserts a [[GridFilterItem]].

Type declaration

    • (item): void
    • Parameters

      Returns void

upsertFilterItems: ((items: GridFilterItem[]) => void)

Updates or inserts many [[GridFilterItem]].

Type declaration

    • (items): void
    • Parameters

      Returns void

Methods

  • Puts the cell corresponding to the given row id and field into edit mode.

    Parameters

    • params: GridStartCellEditModeParams

      The row id and field of the cell to edit.

    Returns void

  • Puts the row corresponding to the given id into edit mode.

    Parameters

    • params: GridStartRowEditModeParams

      The row id edit.

    Returns void

  • Puts the cell corresponding to the given row id and field into view mode and updates the original row with the new value stored. If params.ignoreModifications is true it will discard the modifications made.

    Parameters

    • params: GridStopCellEditModeParams

      The row id and field of the cell to stop editing.

    Returns void

  • Puts the row corresponding to the given id and into view mode and updates the original row with the new values stored. If params.ignoreModifications is true it will discard the modifications made.

    Parameters

    • params: GridStopRowEditModeParams

      The row id and field of the cell to stop editing.

    Returns void