Skip to content

Overview

Revogrid - High-performance, customizable grid library for managing large datasets.

TIP

Read type definition file for the full interface information. All complex property types such as ColumnRegular, ColumnProp, ColumnDataSchemaModel can be found there.

TIP

For a comprehensive events guide, check the dependency tree. All events propagate to the root level of the grid.

Properties

PropertyAttributeDescriptionTypeDefault
accessibleaccessibleEnable accessibility. If disabled, the grid will not be accessible.booleantrue
additionalDataadditional-dataAdditional data to be passed to plugins, renders or editors. For example if you need to pass Vue component instance.any{}
applyOnCloseapply-on-closeApply changes in editor when closed except 'Escape' cases. If custom editor in use method getValue required. Check interfaces.d.ts EditorBase for more info.booleanfalse
autoSizeColumnauto-size-columnAutosize config. Enables columns autoSize. For more details check autoSizeColumn plugin. By default disabled, hence operation is not performance efficient. true to enable with default params (double header separator click for autosize). Or define config. See AutoSizeColumnConfig for more details.boolean | { mode?: ColumnAutoSizeMode | undefined; allColumns?: boolean | undefined; letterBlockSize?: number | undefined; preciseSize?: boolean | undefined; }false
canFocuscan-focusWhen true cell focus appear.booleantrue
canMoveColumnscan-move-columnsEnable column move plugin.booleanfalse
colSizecol-sizeIndicates default column size.number100
columnTypes--Column Types Format. Every type represent multiple column properties. Types will be merged but can be replaced with column properties. Types were made as separate objects to be reusable per multiple columns.{ [name: string]: ColumnType; }{}
columns--Columns - defines an array of grid columns. Can be column or grouped column.(ColumnRegular | ColumnGrouping)[][]
disableVirtualXdisable-virtual-xDisable lazy rendering mode for the X axis. Use when not many columns present and you don't need rerenader cells during scroll. Can be used for initial rendering performance improvement.booleanfalse
disableVirtualYdisable-virtual-yDisable lazy rendering mode for the Y axis. Use when not many rows present and you don't need rerenader cells during scroll. Can be used for initial rendering performance improvement.booleanfalse
editors--Custom editors register.{ [name: string]: EditorCtr; }{}
exportingexportingEnable export plugin.booleanfalse
filterfilterEnables filter plugin. Can be boolean. Or can be filter collection See FilterCollection for more info.boolean | { collection?: FilterCollection | undefined; include?: string[] | undefined; customFilters?: Record<string, CustomFilter<any, LogicFunctionExtraParam>> | undefined; filterProp?: string | undefined; localization?: FilterLocalization | undefined; multiFilterItems?: MultiFilterItem | undefined; disableDynamicFiltering?: boolean | undefined; }false
focusTemplate--Apply changes typed in editor on editor close except Escape cases. If custom editor in use method getValue required. Check interfaces.d.ts EditorBase for more info.(createElement: HyperFunc<VNode>, detail: FocusRenderEvent) => anyundefined
frameSizeframe-sizeDefines how many rows/columns should be rendered outside visible area.number1
grouping--Group rows based on this property. Define properties to be groped by grouping plugin See GroupingOptions.{ props?: ColumnProp[] | undefined; expandedAll?: boolean | undefined; groupLabelTemplate?: GroupLabelTemplateFunc | undefined; }undefined
hideAttributionhide-attributionPlease only hide the attribution if you are subscribed to Pro versionbooleanfalse
jobsBeforeRender--Prevent rendering until job is done. Can be used for initial rendering performance improvement. When several plugins require initial rendering this will prevent double initial rendering.Promise<any>[][]
pinnedBottomSource--Pinned bottom Source: {[T in ColumnProp]: any} - defines pinned bottom rows data source.DataType[][]
pinnedTopSource--Pinned top Source: {[T in ColumnProp]: any} - defines pinned top rows data source.DataType[][]
plugins--Custom grid plugins. Has to be predefined during first grid init. Every plugin should be inherited from BasePlugin.(typeof BasePlugin)[][]
rangerangeWhen true, user can range selection.booleanfalse
readonlyreadonlyWhen true, grid in read only mode.booleanfalse
registerVNode--Register new virtual node inside of grid. Used for additional items creation such as plugin elements. Should be set before grid render inside of plugins.(VNode | (() => VNode))[][]
resizeresizeWhen true, columns are resizable.booleanfalse
rowClassrow-classRow class property mapping. Map custom classes to rows from row object data. Define this property in rgRow object and this will be mapped as rgRow class.string''
rowDefinitions--Custom row properies to be applied. See RowDefinition for more info.RowDefinition[][]
rowHeadersrow-headersExcel like functionality. Show row numbers. Also can be used for custom row header render if object provided.RowHeaders | booleanundefined
rowSizerow-sizeIndicates default rgRow size. By default 0, means theme package size will be applied Alternatively you can use rowSize to reset viewportnumber0
source--Source - defines main data source. Can be an Object or 2 dimensional array([][]); Keys/indexes referenced from columns Prop.DataType[][]
stretchstretchStretch strategy for columns by StretchColumn plugin. For example if there are more space on the right last column size would be increased.boolean | stringfalse
themethemeTheme name.string'default'
trimmedRows--Trimmed rows. Functionality which allows to hide rows from main data set. trimmedRows are physical rgRow indexes to hide.{ [x: number]: boolean; }{}
useClipboarduse-clipboardWhen true enable clipboard.booleantrue

Events

EventDescriptionType
additionaldatachangedEmmited after the additional data is changedCustomEvent<any>
afteranysourceEmitted after each source update, whether from the pinned or main viewport. Useful for tracking all changes originating from sources in both the pinned and main viewports.CustomEvent<{ type: DimensionRows; source: DataType[]; }>
aftercolumnresizeEmitted after column resizing. Useful for retrieving the resized columns.CustomEvent<{ [index: number]: ColumnRegular; }>
aftercolumnssetColumn updatedCustomEvent<{ columns: ColumnCollection; order: Record<ColumnProp, "asc" | "desc" | undefined>; }>
aftereditTriggered after data applied or range changed.CustomEvent<{ data: DataLookup; models: Partial<DataLookup>; type: DimensionRows; } | { prop: ColumnProp; model: DataType; val?: string | undefined; rowIndex: number; colIndex: number; colType: DimensionCols; type: DimensionRows; }>
afterfocusTriggered after focus render finished. Can be used to access a focus element through event.target. This is just a duplicate of afterfocus from revogr-focus.tsx.CustomEvent<FocusAfterRenderEvent>
aftergridinitEmmited after the grid is initialized. Connected to the DOM.CustomEvent<any>
aftergridrenderEmmited after the grid is rendered.CustomEvent<any>
aftersourcesetAfter main source/rows updatedCustomEvent<{ type: DimensionRows; source: DataType[]; }>
afterthemechangedEmmited after the theme is changedCustomEvent<string>
aftertrimmedEmitted after trimmed values have been applied. Useful for notifying when trimming of values has taken place.CustomEvent<any>
beforeanysourceBefore data apply on any source type. Can be source from pinned and main viewport. You can override data source hereCustomEvent<{ type: DimensionRows; source: DataType[]; }>
beforeautofillThis event is triggered before autofill is applied. To prevent the default behavior of applying the edit data, you can call e.preventDefault().CustomEvent<{ type: DimensionRows; colType: DimensionCols; newRange: RangeArea; oldRange: RangeArea; mapping: OldNewRangeMapping; newData: { [key: number]: DataType; }; }>
beforecellfocusThis event is triggered before the cell focus is changed. To prevent the default behavior of changing the cell focus, you can call e.preventDefault().CustomEvent<{ prop: ColumnProp; model: DataType; val?: string | undefined; rowIndex: number; colIndex: number; colType: DimensionCols; type: DimensionRows; }>
beforecolumnappliedEmitted before a column update is applied, after the column set is gathered and the viewport is updated. Useful for performing actions or modifications before the final application of the column update.CustomEvent<{ columns: Record<DimensionCols, ColumnRegular[]>; columnByProp: Record<ColumnProp, ColumnRegular[]>; columnGrouping: ColumnGroupingCollection; maxLevel: number; sort: Record<ColumnProp, ColumnRegular>; }>
beforecolumnssetEmitted before a column update is applied. Listeners can use this event to perform any necessary actions or modifications before the column update is finalized.CustomEvent<{ columns: Record<DimensionCols, ColumnRegular[]>; columnByProp: Record<ColumnProp, ColumnRegular[]>; columnGrouping: ColumnGroupingCollection; maxLevel: number; sort: Record<ColumnProp, ColumnRegular>; }>
beforeeditThis event is triggered before the data is edited. To prevent the default behavior of editing data and use your own implementation, call e.preventDefault(). To override the edit result with your own value, set the e.val property to your desired value.CustomEvent<{ prop: ColumnProp; model: DataType; val?: string | undefined; rowIndex: number; colIndex: number; colType: DimensionCols; type: DimensionRows; }>
beforeeditstartEmitted before editing starts. Use e.preventDefault() to prevent the default edit behavior.CustomEvent<{ prop: ColumnProp; model: DataType; val?: string | undefined; rowIndex: number; colIndex: number; colType: DimensionCols; type: DimensionRows; }>
beforeexportBefore export Use e.preventDefault() to prevent export Replace data in Event in case you want to modify it in exportCustomEvent<{ data: DataType[]; } & ColSource>
beforefilterapplyEmitted before applying a filter to the data source. Use e.preventDefault() to prevent cell focus change. Modify if you need to change filters.CustomEvent<{ collection: FilterCollection; }>
beforefiltertrimmedEmitted before applying a filter to the data source. Use e.preventDefault() to prevent the default behavior of trimming values and applying the filter. Modify the collection property if you want to change the filters. Modify the itemsToFilter property if you want to filter the indexes for trimming.CustomEvent<{ collection: FilterCollection; itemsToFilter: Record<number, boolean>; }>
beforefocuslostThis event is triggered before the grid focus is lost. To prevent the default behavior of changing the cell focus, you can call e.preventDefault().CustomEvent<null | { model: any; cell: Cell; colType: DimensionCols; rowType: DimensionRows; column?: ColumnRegular | undefined; }>
beforegridrenderEmmited before the grid is rendered.CustomEvent<any>
beforerangeTriggered before range applied. Use e.preventDefault() to prevent range.CustomEvent<{ type: DimensionRows; colType: DimensionCols; newRange: RangeArea; oldRange: RangeArea; mapping: OldNewRangeMapping; newData: { [key: number]: DataType; }; }>
beforerangeeditThis event is triggered before applying range data, specifically when a range selection occurs. To customize the data and prevent the default edit data from being set, you can call e.preventDefault().CustomEvent<{ data: DataLookup; models: Partial<DataLookup>; type: DimensionRows; }>
beforerowdefinitionEmitted before the row definition is applied. Useful for modifying or preventing the default row definition behavior.CustomEvent<{ vals: any; oldVals: any; }>
beforesortingTriggered by sorting.plugin.ts Before sorting event. Initial sorting triggered, if this event stops no other event called. Use e.preventDefault() to prevent sorting.CustomEvent<{ column: ColumnRegular; order: "asc" | "desc"; additive: boolean; }>
beforesortingapplyTriggered by sorting.plugin.ts Before sorting apply. Use e.preventDefault() to prevent sorting data change.CustomEvent<{ column: ColumnRegular; order: "asc" | "desc"; additive: boolean; }>
beforesourcesetBefore main source/rows data apply. You can override data source hereCustomEvent<{ type: DimensionRows; source: DataType[]; }>
beforetrimmedEmitted before trimming values. Use e.preventDefault() to prevent the default behavior of trimming values. Modify the trimmed property if you want to filter the indexes for trimming.CustomEvent<{ trimmed: Record<number, boolean>; trimmedType: string; type: string; }>
contentsizechangedNew content size has been applied. The size excludes the header. Currently, the event responsible for applying the new content size does not provide the actual size. To retrieve the actual content size, you can utilize the getContentSize function after the event has been triggered.CustomEvent<"colPinEnd" | "colPinStart" | "rgCol" | "rgRow" | "rowPinEnd" | "rowPinStart">
filterconfigchangedEmitted when the filter configuration is changedCustomEvent<any>
headerclickOn header click.CustomEvent<ColumnRegular>
rowdragstartThis event is triggered when the row order change is started. To prevent the default behavior of changing the row order, you can call e.preventDefault(). To change the item name at the start of the row order change, you can set e.text to the desired new name.CustomEvent<{ pos: PositionItem; text: string; }>
rowheaderschangedEmmited when the row headers are changed.CustomEvent<any>
roworderchangedThis event is triggered before the order of rgRow is applied. To prevent the default behavior of changing the order of rgRow, you can call e.preventDefault().CustomEvent<{ from: number; to: number; }>
viewportscrollEmitted when the viewport is scrolled. Useful for tracking viewport scrolling events.CustomEvent<{ dimension: DimensionType; coordinate: number; delta?: number | undefined; outside?: boolean | undefined; }>

Methods

addTrimmed(trimmed: Record<number, boolean>, trimmedType?: string, type?: DimensionRows) => Promise<CustomEvent<{ trimmed: Record<number, boolean>; trimmedType: string; type: string; }>>

Add trimmed by type

Parameters

NameTypeDescription
trimmed{ [x: number]: boolean; }
trimmedTypestring
typeDimensionRowPin | "rgRow"

Returns

Type: Promise<CustomEvent<{ trimmed: Record<number, boolean>; trimmedType: string; type: string; }>>

clearFocus() => Promise<void>

Clear current grid focus. Grid has no longer focus on it.

Returns

Type: Promise<void>

clearSorting() => Promise<void>

Clears column sorting

Returns

Type: Promise<void>

getColumnStore(type?: DimensionCols) => Promise<Observable<DSourceState<ColumnRegular, DimensionCols>>>

Provides access to column internal store observer Can be used for plugin support

Parameters

NameTypeDescription
typeDimensionColPin | "rgCol"- type of column

Returns

Type: Promise<Observable<DSourceState<ColumnRegular, DimensionCols>>>

getColumns() => Promise<ColumnRegular[]>

Receive all columns in data source

Returns

Type: Promise<ColumnRegular[]>

getContentSize() => Promise<Cell>

Get size of content Including all pinned data

Returns

Type: Promise<Cell>

getFocused() => Promise<FocusedData | null>

Get the currently focused cell.

Returns

Type: Promise<FocusedData | null>

getPlugins() => Promise<PluginBaseComponent[]>

Get all active plugins instances

Returns

Type: Promise<PluginBaseComponent[]>

getSelectedRange() => Promise<RangeArea | null>

Get the currently selected Range.

Returns

Type: Promise<RangeArea | null>

getSource(type?: DimensionRows) => Promise<DataType[]>

Get data from source

Parameters

NameTypeDescription
typeDimensionRowPin | "rgRow"

Returns

Type: Promise<DataType[]>

getSourceStore(type?: DimensionRows) => Promise<Observable<DSourceState<DataType, DimensionRows>>>

Provides access to rows internal store observer Can be used for plugin support

Parameters

NameTypeDescription
typeDimensionRowPin | "rgRow"- type of source

Returns

Type: Promise<Observable<DSourceState<DataType, DimensionRows>>>

getVisibleSource(type?: DimensionRows) => Promise<any[]>

Get data from visible part of source Trimmed/filtered rows will be excluded

Parameters

NameTypeDescription
typeDimensionRowPin | "rgRow"- type of source

Returns

Type: Promise<any[]>

refresh(type?: DimensionRows | "all") => Promise<void>

Refreshes data viewport. Can be specific part as rgRow or pinned rgRow or 'all' by default.

Parameters

NameTypeDescription
typeDimensionRows | "all"

Returns

Type: Promise<void>

scrollToColumnIndex(coordinate?: number) => Promise<void>

Scrolls viewport to specified column by index.

Parameters

NameTypeDescription
coordinatenumber

Returns

Type: Promise<void>

scrollToColumnProp(prop: ColumnProp, dimension?: DimensionTypeCol) => Promise<void>

Scrolls viewport to specified column by prop

Parameters

NameTypeDescription
propstring | number
dimension"rgCol"

Returns

Type: Promise<void>

scrollToCoordinate(cell: Partial<Cell>) => Promise<void>

Scrolls view port to coordinate

Parameters

NameTypeDescription
cell{ x?: number | undefined; y?: number | undefined; }

Returns

Type: Promise<void>

scrollToRow(coordinate?: number) => Promise<void>

Scrolls viewport to specified row by index.

Parameters

NameTypeDescription
coordinatenumber

Returns

Type: Promise<void>

setCellEdit(rgRow: number, prop: ColumnProp, rowSource?: DimensionRows) => Promise<void>

Open editor for cell.

Parameters

NameTypeDescription
rgRownumber
propstring | number
rowSourceDimensionRowPin | "rgRow"

Returns

Type: Promise<void>

setCellsFocus(cellStart?: Cell, cellEnd?: Cell, colType?: string, rowType?: string) => Promise<void>

Set focus range.

Parameters

NameTypeDescription
cellStartCell
cellEndCell
colTypestring
rowTypestring

Returns

Type: Promise<void>

setDataAt(data: { row: number; col: number; } & AllDimensionType) => Promise<void | undefined>

Sets data at specified cell. Useful for performance optimization. No viewport update will be triggered.

Parameters

NameTypeDescription
data{ row: number; col: number; } & AllDimensionType

Returns

Type: Promise<void | undefined>

updateColumnSorting(column: ColumnRegular, index: number, order: "asc" | "desc" | undefined, additive: boolean) => Promise<ColumnRegular>

Update column sorting

Parameters

NameTypeDescription
columnColumnRegular- full column details to update
indexnumber- virtual column index
order"asc" | "desc" | undefined- order to apply
additiveboolean- if false will replace current order

Returns

Type: Promise<ColumnRegular>

updateColumns(cols: ColumnRegular[]) => Promise<void>

Update columns

Parameters

NameTypeDescription
colsColumnRegular[]

Returns

Type: Promise<void>

Slots

SlotDescription
"data-{column-type}-{row-type}."
"focus-{column-type}-{row-type}."

Dependencies

Depends on

Graph


Built with ❤️ by Revolist OU

Revogrid is an open source project by Revolist OU.
Join, contribute, grow with us—everyone is welcome.