API
api/

Options

NOTE This is the API for DataGridXL3 (coming soon). For current version 2, visit V2 API
const options = {
  allowDeleteCols: false,
  rowHeight: 40
};

const grid = new DataGridXL("grid", options);

actions: cell

allowEditCells
boolean
true
Defines if user is allowed to directly edit cells. (This setting does not prevent cut, paste & fillCells actions from modifying any cell values.)
allowFillCells
boolean
true
Defines if user is allowed to fill cells by dragging fill handle.
fillCellsDirection
setting
'xy'
Defines direction(s) in which user can drag to fill cells. (Setting is ignored if allowFillCells is set to false.)
Values: 'x' , 'y' , 'xy'

actions: column

allowDeleteCols
boolean
true
Defines if user is allowed to delete columns.
allowFreezeCols
boolean
true
Defines if user is allowed to freeze (and unfreeze) columns.
allowHideCols
boolean
true
Defines if user is allowed to hide columns.
allowInsertCols
boolean
true
Defines if user is allowed to insert columns.
allowMoveCols
boolean
true
Defines if user is allowed to move columns.
allowResizeCols
boolean
true
Defines if user is allowed to resize columns.

actions: row

allowDeleteRows
boolean
true
Defines if user is allowed to delete rows.
allowFreezeRows
boolean
true
Defines if user is allowed to freeze (and unfreeze) rows.
allowHideRows
boolean
true
Defines if user is allowed to hide rows.
allowInsertRows
boolean
true
Defines if user is allowed to insert rows.
allowMoveRows
boolean
true
Defines if user is allowed to move rows.

axes: column

colAlign
setting
'left'
Default column content alignment. For column header label alignment, use colHeaderLabelAlign instead.
Values: 'left' , 'center' , 'right'
colHeaderHeight
number
32
Height of column headers in pixels.
colHeaderLabelAlign
setting
'left'
Default label alignment of column headers.
Values: 'left' , 'center' , 'right'
colHeaderLabelFunction
function
Provide a custom function that returns a string label for every column header. Overrides labelType, labelPrefix and labelSuffix options. HTML supported.
colHeaderLabelPrefix
string
''
A string to prepend to column header label.
colHeaderLabelSuffix
string
''
A string to append to column header label.
colHeaderLabelType
setting
'letters'
Defines label series type for untitled columns. numbers for 1,2,3; letters for A,B,C.
Values: 'letters' , 'numbers'
colWidth
number
100
Default column width in pixels
frozenCols
number
0
Defines amount of frozen cols (this includes any hidden columns).

axes: row

frozenRows
number
0
Defines amount of frozen rows (this includes any hidden rows).
rowHeaderLabelAlign
setting
'left'
Label alignment of row headers. Applies to all.
Values: 'left' , 'center' , 'right'
rowHeaderLabelFunction
function
Provide a custom function that returns a string label for every row header. Overrides labelType, labelPrefix and labelSuffix options.
rowHeaderLabelPrefix
string
''
A string to prepend to row header label.
rowHeaderLabelSuffix
string
''
A string to append to row header label.
rowHeaderLabelType
setting
'numbers'
Defines label series type for untitled columns. numbers for 1,2,3; letters for A,B,C.
Values: 'letters' , 'numbers'
rowHeaderWidth
number
52
Width of row headers in pixels.
rowHeight
number
26
Row height in pixels. The row height applies to every single row in the grid.

clipboard

allowCopy
boolean
true
Defines if user is allowed to copy cell values.
allowCut
boolean
true
Defines if user is allowed to cut cell values.
allowPaste
boolean
true
Defines if user is allowed to paste cell values.
expandSheetOnPaste
boolean
false
Defines if document should expand when pasting a selection that exceeds document bounds.

contextmenu

contextMenuItems
array
Takes an array of context menu items.

developer

useInspector
boolean
false
Enables inspector for development purposes

indicators

changeIndicator
string
Change Indicator
sortIndicator
string
Sort Indicator
sortIndicatorAsc
string
Sort Indicator
sortIndicatorDesc
string
Sort Indicator

instance

bottomBar
array
Pass in theme settings to override default theme. Theme affects colors and opacities of elements inside grid view.
licenseKey
string
Your DataGridXL License Key
topBar
array
Pass in theme settings to override default theme. Theme affects colors and opacities of elements inside grid view.

locale

locale
object
Pass in locale settings to override default locale.

renderer

renderer
setting
'snap'
Defines renderer
Values: 'snap' , 'smooth'

sort

sortReach
setting
'all'
Sort all or only visible rows
Values: all , visible
undoableSortState
boolean
true
Undoable sort (setSortState)

theme

theme
Theme
Pass in theme settings to override default theme. Theme affects colors and opacities of elements inside grid view.
ids
Required
Only argument of deleteRowsById method
• Array.rowid
Playground

Coming Soon

DataGridXL Playground

Try out the full DataGridXL API right here on this page!