JavaScript Data Grid BaseEditor

Members

BaseEditor

Source code (opens new window)

baseEditor.BaseEditor

_closeCallback

Source code (opens new window)

baseEditor._closeCallback : function

Callback to call after closing editor.

cellProperties

Source code (opens new window)

baseEditor.cellProperties : object

Object containing the cell's properties.

col

Source code (opens new window)

baseEditor.col : number

Visual column index.

hot

Source code (opens new window)

baseEditor.hot : Handsontable

A reference to the source instance of the Handsontable.

originalValue

Source code (opens new window)

baseEditor.originalValue : *

Original cell's value.

prop

Source code (opens new window)

baseEditor.prop : number | string

Column property name or a column index, if datasource is an array of arrays.

row

Source code (opens new window)

baseEditor.row : number

Visual row index.

state

Source code (opens new window)

baseEditor.state : string

Editor's state.

TD

Source code (opens new window)

baseEditor.TD : HTMLTableCellElement

Currently rendered cell's TD element.

Methods

beginEditing

Source code (opens new window)

baseEditor.beginEditing(newInitialValue, event)

Begins editing on a highlighted cell and hides fillHandle corner if was present.

Param Type Description
newInitialValue * The initial editor value.
event Event The keyboard event object.

cancelChanges

Source code (opens new window)

baseEditor.cancelChanges()

Finishes editing without singout saving value.

close

Source code (opens new window)

baseEditor.close()

Required method to close editor.

discardEditor

Source code (opens new window)

baseEditor.discardEditor(result)

Verifies result of validation or closes editor if user's cancelled changes.

Param Type Description
result boolean
undefined
If false and the cell using allowInvalid option, then an editor won't be closed until validation is passed.

enableFullEditMode

Source code (opens new window)

baseEditor.enableFullEditMode()

Switch editor into full edit mode. In this state navigation keys don't close editor. This mode is activated automatically after hit ENTER or F2 key on the cell or while editing cell press F2 key.

extend

Source code (opens new window)

baseEditor.extend() ⇒ function

Fallback method to provide extendable editors in ES5.

finishEditing

Source code (opens new window)

baseEditor.finishEditing(restoreOriginalValue, ctrlDown, callback)

Finishes editing and start saving or restoring process for editing cell or last selected range.

Param Type Description
restoreOriginalValue boolean If true, then closes editor without saving value from the editor into a cell.
ctrlDown boolean If true, then saveValue will save editor's value to each cell in the last selected range.
callback function The callback function, fired after editor closing.

getEditedCell

Source code (opens new window)

baseEditor.getEditedCell() ⇒ HTMLTableCellElement | null

Gets HTMLTableCellElement of the edited cell if exist.

getEditedCellRect

Source code (opens new window)

baseEditor.getEditedCellRect() ⇒ Object | undefined

Gets the object that provides information about the edited cell size and its position relative to the table viewport.

The rectangle has six integer properties:

  • top The top position relative to the table viewport
  • start The left (or right in RTL) position relative to the table viewport
  • width The cell's current width;
  • maxWidth The maximum cell's width after which the editor goes out of the table viewport
  • height The cell's current height;
  • maxHeight The maximum cell's height after which the editor goes out of the table viewport

getEditedCellsLayerClass

Source code (opens new window)

baseEditor.getEditedCellsLayerClass() ⇒ string

Gets className of the edited cell if exist.

getValue

Source code (opens new window)

baseEditor.getValue()

Required method to get current value from editable element.

init

Source code (opens new window)

baseEditor.init()

Initializes an editor's intance.

isInFullEditMode

Source code (opens new window)

baseEditor.isInFullEditMode() ⇒ boolean

Checks if editor is in full edit mode.

isOpened

Source code (opens new window)

baseEditor.isOpened() ⇒ boolean

Returns information whether the editor is open.

isWaiting

Source code (opens new window)

baseEditor.isWaiting() ⇒ boolean

Returns information whether the editor is waiting, eg.: for async validation.

open

Source code (opens new window)

baseEditor.open()

Required method to open editor.

prepare

Source code (opens new window)

baseEditor.prepare(row, col, prop, td, value, cellProperties)

Prepares editor's meta data.

Param Type Description
row number The visual row index.
col number The visual column index.
prop number
string
The column property (passed when datasource is an array of objects).
td HTMLTableCellElement The rendered cell element.
value * The rendered value.
cellProperties object The cell meta object (see Core#getCellMeta).

saveValue

Source code (opens new window)

baseEditor.saveValue(value, ctrlDown)

Saves value from editor into data storage.

Param Type Description
value * The editor value.
ctrlDown boolean If true, applies value to each cell in the last selected range.

setValue

Source code (opens new window)

baseEditor.setValue()

Required method to set new value into editable element.

Last update: Apr 16, 2024