Infinite Table API

When rendering the InfiniteTable component, you can get access to the API by getting it from the onReady callback prop.

const onReady = (
  {api, dataSourceApi}: {
    api: InfiniteTableApi<DATA_TYPE>,
    dataSourceApi: DataSourceApi<DATA_TYPE>
  }) => {
  // api is accessible here
  // you may want to store a reference to it in a ref or somewhere in your app state
}

<InfiniteTable<DATA_TYPE>
  columns={[...]}
  onReady={onReady}

For API on row/group selection, see the Selection API page.

cancelEdit

() => void

Cancels the current edit operation and closes the editor.

cellSelectionApi

InfiniteTableCellSelectionApi

Getter for the Cell Selection API

clearColumnFilter

(columnId: string) => void

Clears any filter for the specified column

collapseGroupRow

(groupKeys: any[]) => boolean

Collapses the specified group row. Returns true if the group was expanded and is now being collapsed.

confirmEdit

(value?: any) => void

Confirms the current edit operation and closes the editor.

expandGroupRow

(groupKeys: any[]) => boolean

Expands the specified group row. Returns true if the group was collapsed and is now being expanded.

getCellValue

({columnId, rowIndex?, primaryKey? }) => any

Returns the value for the specified cell. The value is either the raw value (as retrieved via the field property of the column or by calling the column valueGetter) or the formatted value - if the column has a valueFormatter.

getCellValues

({columnId, rowIndex?, primaryKey? }) => ({value, rawValue, formattedValue })

Returns an object with raw and formatted values for the specified cell.

getColumnApi

(colIdOrIndex: string|number) => InfiniteTableColumnAPI

Returns a column API object bound to the specified column

getSortingForColumn

(columnId: string)=> 1|-1|null

Returns the sorting currently applied to the specified column.

getVerticalRenderRange

() => { renderStartIndex, renderEndIndex }

Returns the vertical render range of the table

onReady

({ api, dataSourceApi }) => void

Called when the table has been layed out and sized and is ready to be used.

rejectEdit

(error: Error) => void

Rejects the current edit operation with the specified error and closes the editor.

rowSelectionApi

InfiniteTableRowSelectionApi

Getter for the Row Selection API

scrollCellIntoView

(rowIndex: number; colIdOrIndex: string | number) => boolean

Can be used to scroll a cell into the visible viewport

scrollColumnIntoView

(colId: string) => boolean

Can be used to scroll a column into the visible viewport

scrollLeft

getter<number>|setter<number>

Gets or sets the scrollLeft value in the grid viewport

scrollRowIntoView

(rowIndex: number) => boolean

Can be used to scroll a row into the visible viewport

scrollTop

getter<number>|setter<number>

Gets or sets the scrollTop value in the grid viewport

setColumnFilter

(columnId: string, value: any) =>void

Sets a filter value for the specified column

setColumnOrder

(columnIds: string[] | true) => void

Set the column order.

setSortingForColumn

(columnId: string, dir: 1|-1|null) => void

Sets the sorting for the specified column.

startEdit

({ rowIndex, columnId }) => Promise<boolean>

Tries to start editing the cell specified by the given row index and column id.

toggleGroupRow

(groupKeys: any[]) => void

Toggles the collapse/expand state of the specified group row

toggleSortingForColumn

(columnId: string, options?) => void

Toggles the sorting for the specified column.