Documentation

@kanunilabs/pivotgrid


@kanunilabs/pivotgrid / PivotGridApi

Interface: PivotGridApi<TRow>

The instance handle. controller is the full engine — same object the React onReady hands out.

Type Parameters

TRow

TRow = unknown

Properties

controller

controller: PivotController<TRow>


element

element: HTMLElement

Methods

applyTransaction()

applyTransaction(transaction): PivotTransactionResult

Add, update and remove rows without rebuilding (live updates) — see PivotController.applyTransaction. Rows are matched by the rowKey option.

Parameters

transaction

PivotRowTransaction<TRow>

Returns

PivotTransactionResult


applyTransactionAsync()

applyTransactionAsync(transaction, callback?): void

Queue a transaction; queued ones are merged and applied together after asyncTransactionWait ms — for a feed that ticks many times a second. See PivotController.applyTransactionAsync.

Parameters

transaction

PivotRowTransaction<TRow>

callback?

() => void

Returns

void


destroy()

destroy(): void

Returns

void


flushAsyncTransactions()

flushAsyncTransactions(): void

Apply the queued transactions now.

Returns

void


setData()

setData(data): void

Replace every row (a full rebuild).

Parameters

data

TRow[]

Returns

void


setDensity()

setDensity(density): void

Switch the row rhythm (compact / normal / comfortable) and repaint.

Parameters

density

PivotDensity | undefined

Returns

void


setFields()

setFields(fields): void

Parameters

fields

PivotField<TRow, PivotCellTemplate, any>[]

Returns

void


setLocale()

setLocale(locale, dictionary?, rtl?): void

Parameters

locale

PivotLocale

dictionary?

Partial<PivotDictionary>

rtl?

boolean

Returns

void


setSearchText()

setSearchText(text): void

Quick search over the row members; '' clears it. See PivotController.setSearchText.

Parameters

text

string

Returns

void