API REFERENCE
GridRowRef
Fields, allowed values, and APIs that use GridRowRef.
Type definition
A question mark (?) marks an optional field; readonly marks a value you should not change directly. A union (|) accepts one of the listed forms. Functions are callbacks that Grid invokes at the relevant point.
export interface GridRowRef<
TData = GridData,
TContext = unknown,
> extends GridLiveRef<TData> {
readonly id: GridRowId;
getSourceIndex(): number | null;
getDisplayIndex(): number | null;
getData(): Readonly<TData> | null;
getParent(): GridRowRef<TData, TContext> | null;
getChildren(): ReadonlyArray<GridRowRef<TData, TContext>>;
isGroup(): boolean;
isLeaf(): boolean;
isMaster(): boolean;
isDetail(): boolean;
getLevel(): number;
getRoute(): readonly string[];
isSelected(): boolean;
isExpanded(): boolean;
setSelected(selected: boolean): Promise<boolean>;
setExpanded(expanded: boolean): Promise<boolean>;
setData(data: TData): Promise<boolean>;
updateData(patch: Partial<TData>): Promise<boolean>;
setValue<TField extends GridFieldPath<TData>>(
field: TField,
value: GridPathValue<TData, TField>,
): Promise<boolean>;
setHeight(height: number | null): Promise<boolean>;
focus(field?: GridFieldPath<TData>): Promise<boolean>;
startEditing(field: GridFieldPath<TData>): Promise<boolean>;
}APIs using this type
- getRow
Finds a row object by stable row ID, rather than display index.
- getDisplayedRowAtIndex
Finds a row object by its current display index. Sorting, filtering, and grouping can change the row at an index.
- forEachRow
Runs a callback for each row object. Use forEachDisplayedRow when display order matters.
- forEachDisplayedRow
Iterates current displayed rows for app features that distinguish source order from display order.