Documentation

@kanunilabs/pivotgrid-react


@kanunilabs/pivotgrid-react / PivotControllerCallbacks

Interface: PivotControllerCallbacks<TRow>

Extended by

Type Parameters

TRow

TRow = any

Properties

dictionary?

optional dictionary?: Partial<PivotDictionary>

The grid's resolved dictionary (the locale's words and the app's overrides). The renderers set it; exports take the words of the file from it (B.68).


onAfterPivotCalculate?

optional onAfterPivotCalculate?: (result) => void

Parameters

result

PivotEngineResult

Returns

void


onBeforePivotCalculate?

optional onBeforePivotCalculate?: () => void

Returns

void


onChartStateLoaded?

optional onChartStateLoaded?: (chartState) => void

Parameters

chartState

any

Returns

void


onComputingChange?

optional onComputingChange?: (computing) => void

isComputing changed: true when a change starts computing, false when its result is shown (B.31). exportData waits for false before it writes. The export waits without a time limit, a slow serverSource.compute included. Print and clipboard run after the wait, so a browser may refuse them once the click that asked for them has expired.

Parameters

computing

boolean

Returns

void


onError?

optional onError?: (error) => void

Parameters

error

Error

Returns

void


onExporting?

optional onExporting?: (e) => void

Parameters

e

ExportingEvent

Returns

void


onFieldGroupChange?

optional onFieldGroupChange?: (e) => void

A field group changed from the screen or changeFieldGroup (Enterprise, B.120); after the change.

Parameters

e

PivotFieldGroupChangeEvent<TRow>

Returns

void


onFieldMove?

optional onFieldMove?: (e) => void | Promise<void>

Parameters

e

FieldMoveEvent

Returns

void | Promise<void>


onFieldsChange?

optional onFieldsChange?: (fields) => void

Parameters

fields

PivotField<TRow, PivotCellTemplate, any>[]

Returns

void


onLargeExport?

optional onLargeExport?: (info) => boolean | void | Promise<boolean | void>

Before a styled Excel export gives way to the plain one; false cancels (B.23). See ExportOptions.onLargeExport.

Parameters

info

LargeExportInfo

Returns

boolean | void | Promise<boolean | void>


onLayoutChange?

optional onLayoutChange?: (layout) => void

Parameters

layout

PivotLayoutState

Returns

void


onRefresh?

optional onRefresh?: () => void

Returns

void


onRestoredExpansionCollapsed?

optional onRestoredExpansionCollapsed?: (e) => void

The open state that was put back was dropped: the grid would have held nodes row nodes, more than maxRestoredOpenNodes (limit), so the tree would not fit in memory. The grid opened with every row group closed, and that is the state it saves from now on. Called once per grid; tell the reader why ("this report was too large to restore the way it was saved, so it opened collapsed"). nodes counts what the grid would hold, not the rows it would show (see maxRestoredOpenNodes). In development, React StrictMode creates the controller twice, so the callback can fire twice there.

Parameters

e
limit

number

nodes

number

Returns

void