DataGridXL - API

Options

Options ...

Example

js
grid.selectCell(3, 0);
grid.updateConfig({ allowEditCells: false });

Options

actions:col

allowAlignboolean

Defines if user is allowed to modify column text alignment.

Defaultfalse
allowDeleteColsboolean

Defines if user is allowed to delete columns.

Defaulttrue
allowFreezeColsbooleanpro

Defines if user is allowed to freeze (and unfreeze) columns. Not suitable for production yet.

Defaultfalse
allowHideColsboolean

Defines if user is allowed to hide columns.

Defaulttrue
allowInsertColsboolean

Defines if user is allowed to insert columns.

Defaulttrue
allowMoveColsboolean

Defines if user is allowed to move columns.

Defaulttrue
allowResizeColsboolean

Defines if user is allowed to resize columns.

Defaulttrue

clipboard

allowCopyboolean

Defines if user is allowed to copy cell values.

Defaulttrue
allowCutboolean

Defines if user is allowed to cut cell values.

Defaulttrue
allowPasteboolean

Defines if user is allowed to paste cell values.

Defaulttrue
expandSheetOnPasteboolean

Defines if document should expand when pasting a selection that exceeds document bounds.

Defaultfalse

actions:row

allowDeleteRowsboolean

Defines if user is allowed to delete rows.

Defaulttrue
allowFreezeRowsbooleanpro

Defines if user is allowed to freeze (and unfreeze) rows. Not suitable for production yet.

Defaultfalse
allowHideRowsboolean

Defines if user is allowed to hide rows.

Defaulttrue
allowInsertRowsboolean

Defines if user is allowed to insert rows.

Defaulttrue
allowMoveRowsboolean

Defines if user is allowed to move rows.

Defaulttrue

actions:cell

allowEditCellsboolean

Defines if user is allowed to directly edit cells. (This setting does not prevent cut, paste & fillCells actions from modifying any cell values.)

Defaulttrue
allowFillCellsbooleanpro

Defines if user is allowed to fill cells by dragging fill handle.

Defaulttrue
allowSortbooleanpro

Defines if user is allowed to sort.

Defaulttrue
fillCellsDirectionpro

Defines direction(s) in which user can drag to fill cells. (Setting is ignored if allowFillCells is set to false.)

Default'y'
Values'x''y''xy'

instance

bottomBararray

Pass in theme settings to override default theme. Theme affects colors and opacities of elements inside grid view.

Default[ { part: "credits" }, { part: "inputBar", width: '60%' }, { part: "searchBar", width: '40%' }, { part: "fullscreenButton" } ];
licenseKeystringpro

Your DataGridXL License Key

Defaultundefined
topBararray

Pass in theme settings to override default theme. Theme affects colors and opacities of elements inside grid view.

Default[];

axes:col

colAlign

Default column content alignment. For column header label alignment, use colHeaderLabelAlign instead.

Default'left'
Values'left''center''right'
colHeaderHeightnumber

Height of column headers in pixels.

Default32
colHeaderLabelFunctionfunction

Provide a custom function that returns a string label for every column header. Overrides labelType, labelPrefix and labelSuffix options. HTML supported.

Defaultfunction colHeaderLabelFunction(colRef, labels){ if(colRef.title){ return colRef.title || ''; } else { // return label return `${this.options.colHeaderLabelPrefix||''}${labels?.[this.options.colHeaderLabelType]||''}${this.options.colHeaderLabelSuffix||''}`; } }
colHeaderLabelPrefixstring

A string to prepend to column header label.

Default''
colHeaderLabelSuffixstring

A string to append to column header label.

Default''
colHeaderLabelType

Defines label series type for untitled columns. numbers for 1,2,3; letters for A,B,C.

Default'letters'
Values'letters''numbers'
columnSettingsobject

Takes an object of column settings

Default{ width: 100, align: 'left', headerAlign: 'left', readOnly: false, type: 'text', picker: undefined, pickerOptions: {}, formatFunction: undefined, parseFunction: undefined, validateFunction: undefined, styleFunction: undefined, sortFunction: undefined, isToggle: false, hideText: false };
colWidthnumber

Default column width in pixels

Default100
frozenColsnumberpro

Defines amount of frozen cols (this includes any hidden columns).

Default0

contextmenu

contextMenuItemsarray

Takes an array of context menu items.

Default[ "cut", "copy", "paste", "align_left", "align_center", "align_right", "hide_cols", "hide_rows", "insert_empty_cols_before", "insert_empty_cols_after", "delete_cols", "insert_empty_rows_before", "insert_empty_rows_after", "delete_rows", "sort_asc", "sort_desc" ]

renderer

fontSizenumbercore

Font size in pixels

Default10

axes:row

frozenRowsnumberpro

Defines amount of frozen rows (this includes any hidden rows).

Default0
rowHeaderLabelAlign

Label alignment of row headers. Applies to all.

Default'left'
Values'left''center''right'
rowHeaderLabelFunctionfunction

Provide a custom function that returns a string label for every row header. Overrides labelType, labelPrefix and labelSuffix options.

Defaultfunction rowHeaderLabelFunction(rowRef, labels){ if(rowRef.title){ return rowRef.title || ''; } else { // return label return `${this.options.rowHeaderLabelPrefix||''}${labels?.[this.options.rowHeaderLabelType]||''}${this.options.rowHeaderLabelSuffix||''}`; } }
rowHeaderLabelPrefixstring

A string to prepend to row header label.

Default''
rowHeaderLabelSuffixstring

A string to append to row header label.

Default''
rowHeaderLabelType

Defines label series type for untitled columns. numbers for 1,2,3; letters for A,B,C.

Default'numbers'
Values'letters''numbers'
rowHeaderWidthnumber

Width of row headers in pixels.

Default52
rowHeightnumber

Row height in pixels. The row height applies to every single row in the grid.

Default26

locale

localeobject

Pass in locale settings to override default locale.

Default{ "Copy" : null, "Cut" : null, "Paste" : null, "Delete Row(s)" : null, "Hide Row" : null, "Hide $n Rows" : null, "Hide Column" : null, "Hide $n Columns" : null, "Insert Row (up)" : null, "Insert $n Rows (up)" : null, "Insert Row (down)" : null, "Insert $n Rows (down)" : null, "Delete Column(s)" : null, "Insert Column (left)" : null, "Insert $n Columns (left)" : null, "Insert Column (right)" : null, "Insert $n Columns (right)" : null, "$n from $total" : null, "Deselect" : null, "Sort A to Z" : null, "Sort Z to A" : null }

sort

sortReach

Sort all or only visible rows

Default'all'
Valuesallvisible

theme

themeTheme

Pass in theme settings to override default theme. Theme affects colors and opacities of elements inside grid view.

Defaultimport light from './../presets/themes/light.js'; light;

developer

useInspectorboolean

Enables inspector for development purposes

Defaultfalse