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.

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

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.

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

selectionApi

InfiniteTableSelectionApi

Getter for the Selection API

setColumnFilter

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

Sets a filter value for the specified column

setColumnOrder

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

Set the column order.

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