API
api/

Methods

NOTE This is the API for DataGridXL3 (coming soon). For current version 2, visit V2 API
const grid = new DataGridXL("grid", ...);

grid.setCellValues({x:0,y:0}, "New Value");
grid.selector.selectAll();

actions: cell

clearCellValues
(cells)
fillCells
(cellRange,fillDirection,fillAmount)
setCellValues
(cells,values,[mayExceedCellRange],[cellRangeToCut])
toggleCellValues
(cells)

actions: column

deleteCols
(cols)
deleteColsById
(colIds)
freezeCols
(amount)
freezeColsUntilId
(colId)
hideCols
(cols)
hideColsById
(colIds)
insertEmptyCols
(amount,colCoord)
moveCols
(cols,colCoord)
resizeCols
(cols,width)
resizeColsToFit
(cols)
showColsById
(colIds)

actions: row

deleteRows
(rows)
deleteRowsById
(ids)
freezeRows
(amount)
freezeRowsUntilId
(rowId)
hideRows
(rows)
hideRowsById
(rowIds)
insertEmptyRows
(amount,rowCoord)
moveRows
(rows,rowCoord)
showRowsById
(rowIds)

actions: sort

sort
(colCoord,sortDirection)

clipboard

copy
()
cut
()
paste
()

dimensions

getBottomBarSpace
()
returns height in pixels number
getTopBarSpace
()
returns height in pixels number
getWindowOffset
()
returns window scroll offset {x,y} object

download

downloadCSV
()
downloadJSON
()

fullscreen

activateFullscreen
()
toggleFullscreen
()

helpers

getSpreadsheetCoords
(cellCoords)
returns spreadsheet-style label (E.g. "A2", "C23", ...) string

instance

activate
()
deactivate
()
destroy
()
getInteractionMode
()
returns active interaction mode ('ready','enter','edit','contextmenu')
setInteractionMode
(interactionMode)

localization

getLocalizedValue
(value)
returns localized string string

search

clearSearch
()
search
(searchStr)
searchNext
()
searchPrev
()

sort

applySortState
(sortState)

theme

setTheme
(theme)

undo-redo

redo
()
undo
()
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!