dhtmlxSpreadSheet API

Constructor

var spreadsheet = new dhx.Spreadsheet("spreadsheet_container", {
    rowsCount:20,
    colsCount:20
});

Parameters:

  • an HTML container (or the ID of an HTML container)
  • a hash of config options (check below)
Objects
Methods
addColumn adds a new column into the spreadsheet
addRow adds a new row into the spreadsheet
deleteColumn removes a column from the spreadsheet
deleteRow removes a row from the spreadsheet
eachCell iterates over cells in the spreadsheet
endEdit finishes editing in a cell
getStyle returns styles applied to the spreadsheet cells
getValue returns the value(s) of a cell(s)
isLocked checks whether a cell is locked
load loads data from an external file
lock locks the specified cell
parse loads data into spreadsheet from a local data source
redo applies the reverted action once again
serialize serializes data of spreadsheet into an array of JSON objects
setStyle applies styling to spreadsheet cells
setValue sets a value for a cell(s)
startEdit starts editing in a cell
undo reverts the latest action
unlock unlocks a locked cell

Selection

getFocusedCell returns the id of a focused cell
getSelectedCells returns the id(s) of selected cells
setFocusedCell sets focus on the specified cell
setSelectedCells selects the specified cell(s)

Events Bus

detach detaches a handler from an event (which was attached before by the on() method)
fire triggers an inner event
on attaches a handler to an inner event of SpreadSheet
Events
AfterEditEnd fires after editing of a cell is finished
AfterEditStart fires after editing of a cell has started
AfterFocusSet fires after focus is set on a cell
AfterSelectionSet fires after cells are selected
AfterStyleChange fires after the style of a cell is changed
AfterValueChange fires after the value of a cell is changed
BeforeEditEnd fires before editing of a cell is finished
BeforeEditStart fires before editing of a cell has started
BeforeFocusSet fires before focus is set on a cell
BeforeSelectionSet fires before cells are selected
BeforeStyleChange fires before the style of a cell is changed
BeforeValueChange fires before the value of a cell is changed
Properties
colsCount sets the number of columns a spreadsheet will have on initialization
editLine shows/hides the editing bar
menu shows/hides the menu
readonly enables/disables the readonly mode
rowsCount sets the number of rows a spreadsheet will have on initialization
toolbarBlocks specifies blocks that will be shown in the toolbar of spreadsheet
Back to top