Members

constantCOLUMNS_PROPS_CONFLICTSArray.<string>

List of props which have to be cleared in the column meta-layer. That props have a
different meaning when using in column meta.

constantCONTEXT_MENU_ITEMS_NAMESPACE

Constants for parts of translation.

constantDEFAULT_TRAVERSAL_STRATEGYstring

Default strategy for tree traversal.

constantDEPRECATED_HOOKSMap.<string, string>

The list of the hooks which are deprecated. The warning message is printed out in
the developer console when the hook is used.

The Map key is represented by hook name and its value keeps message which whould be
printed out when the hook is used.

Usage:

...
New Map([
  ['beforeColumnExpand', 'The plugin hook "beforeColumnExpand" is deprecated. Use "beforeColumnExpand2" instead.'],
])
...
```.

constantHEADER_CONFIGURABLE_PROPSArray.<string>

List of properties which are configurable. That properties can be changed using public API.

constantHEADER_DEFAULT_SETTINGSobject

Default properties for nested header settings.

constanthooksRefRegistererobject

Mixin object to extend objects functionality for auto registering hooks in an Handsontable instance.

lastHeightnumber

Cached height of the rootElement.

lastWidthnumber

Cached width of the rootElement.

listenersCounternumber

Counter which tracks unregistered listeners (useful for detecting memory leaks).

constantlocalHooksobject

Mixin object to extend objects functionality for local hooks.

constantOPERATION_NAME

When "inser_column" is triggered the following operations must be performed:

  • All formulas which contain cell coordinates must be updated and saved into source data - Column must be increased
    by "amount" of times (eq: D4 to E4, $F$5 to $G$5);
  • Mark all formulas which need update with "STATE_OUT_OFF_DATE" flag, so they can be recalculated after the operation.

constantOPERATION_NAME

When "column_sorting" is triggered the following operations must be performed:

  • All formulas which contain cell coordinates must be updated and saved into source data - Column must be changed
    (decreased or increased) depends on new target position - previous position.
  • Mark all formulas which need update with "STATE_OUT_OFF_DATE" flag, so they can be recalculated after the operation.

constantOPERATION_NAME

When "remove_row" is triggered the following operations must be performed:

  • All formulas which contain cell coordinates must be updated and saved into source data - Row must be decreased
    by "amount" of times (eq: D4 to D3, $F$5 to $F$4);
  • Mark all formulas which need update with "STATE_OUT_OFF_DATE" flag, so they can be recalculated after the operation.

constantOPERATION_NAME

When "remove_column" is triggered the following operations must be performed:

  • All formulas which contain cell coordinates must be updated and saved into source data - Column must be decreased
    by "amount" of times (eq: D4 to C4, $F$5 to $E$5);
  • Mark all formulas which need update with "STATE_OUT_OFF_DATE" flag, so they can be recalculated after the operation.

constantOPERATION_NAME

When "insert_row" is triggered the following operations must be performed:

  • All formulas which contain cell coordinates must be updated and saved into source data - Row must be increased
    by "amount" of times (eq: D4 to D5, $F$5 to $F$6);
  • Mark all formulas which need update with "STATE_OUT_OFF_DATE" flag, so they can be recalculated after the operation.

constantREGISTERED_HOOKS

Handsontable events are the common interface that function in 2 ways: as callbacks and as hooks.

Example
// Using events as callbacks:
...
const hot1 = new Handsontable(document.getElementById('example1'), {
  afterChange: function(changes, source) {
    $.ajax({
      url: "save.php',
      data: change
    });
  }
});
...
// Using events as plugin hooks:
...
const hot1 = new Handsontable(document.getElementById('example1'), {
  myPlugin: true
});

const hot2 = new Handsontable(document.getElementById('example2'), {
  myPlugin: false
});

// global hook
Handsontable.hooks.add('afterChange', function() {
  // Fired twice - for hot1 and hot2
  if (this.getSettings().myPlugin) {
    // function body - will only run for hot1
  }
});

// local hook (has same effect as a callback)
hot2.addHook('afterChange', function() {
  // function body - will only run in #example2
});

...

constantREMOVED_HOOKSMap.<string, string>

The list of the hooks which are removed from the API. The warning message is printed out in
the developer console when the hook is used.

The Map key is represented by hook name and its value points to the Handsontable version
in which it was removed.

constantREMOVED_MESSAGEstring

Template warning message for removed hooks.

constantstateSaverobject

Mixin object to extend functionality for save/restore object state.

constantTRAVERSAL_BFstring

Breadth-first traversal strategy (https://en.wikipedia.org/wiki/Tree_traversal#Breadth-first_search_/_level_order).

constantTRAVERSAL_DF_POSTstring

Depth-first post-order strategy (https://en.wikipedia.org/wiki/Tree_traversal#Post-order_(NLR)).

constantTRAVERSAL_DF_PREstring

Depth-first pre-order strategy (https://en.wikipedia.org/wiki/Tree_traversal#Pre-order_(NLR)).

constantTRAVERSAL_STRATEGIESMap.<string, function()>

Collection of all available tree traversal strategies.

constantTYPESobject

Default types and order for filter conditions.

Methods

_dataToHTML(input){string}

Converts 2D array into HTMLTableElement.

Parameters:
Name Type Description
input Array

Input array which will be converted to HTMLTable.

Returns: {string} OuterHTML of the HTMLTableElement.

_getEditorInstance(name, hotInstance){function}

Returns instance (singleton) of editor class.

Parameters:
Name Type Description
name string

Name of an editor under which it has been stored.

hotInstance object

Instance of Handsontable.

Returns: {function} Returns instance of editor.

_getItem(name){object}

Retrieve cell type object.

Parameters:
Name Type Description
name string

Cell type identification.

Returns: {object} Returns cell type object.

_getItem(name){function}

Retrieve validator function.

Parameters:
Name Type Description
name string

Validator identification.

Returns: {function} Returns validator function.

_getItem(name){function}

Retrieve renderer function.

Parameters:
Name Type Description
name string

Renderer identification.

Returns: {function} Returns renderer function.

_getItem(name){function}

Retrieve editor class.

Parameters:
Name Type Description
name string

Editor identification.

Returns: {function} Returns editor class.

_getKeyByStorageIndex(dataIndex){number}

Gets the key associated with the specified value calculated from storage index.

Parameters:
Name Type Description
dataIndex number

Zero-based storage index.

Returns: {number} Returns index 0-N or -1 if no key found.

_getRefCount(){number}

Returns reference count. Useful for debugging and testing purposes.

Returns: {number}

_getStorageIndexByKey(key){number}

Gets storage index calculated from the key associated with the specified value.

Parameters:
Name Type Description
key number

Volatile zero-based index.

Returns: {number} Returns index 0-N or -1 if no storage index found.

_register(name, type)

Register cell type under specified name.

Parameters:
Name Type Description
name string

Cell type identification.

type object

An object with contains keys (eq: editor, renderer, validator) which describes specified behaviour of the cell.

_register(name, editorClass)

Register editor class under specified name.

Parameters:
Name Type Description
name string

Editor identification.

editorClass function

Editor class.

_resetState()

Remove all listeners attached to the DOM and clear all previously saved states.

addChild(node)

Adds a node to tree leaves. Added node is linked with the parent node through "parent" property.

Parameters:
Name Type Description
node TreeNode

A TreeNode to add.

addClass(element, className)

Add class name to an element.

Parameters:
Name Type Description
element HTMLElement

An element to process.

className string | Array

Class name as string or array of strings.

addEvent(element, event, callback)

Parameters:
Name Type Description
element HTMLElement

An element to which the event is added.

event string

The event name.

callback function

The callback to add.

addItem(key, item)

Add new predefined menu item to the collection.

Parameters:
Name Type Description
key string

Menu command id.

item object

Object command descriptor.

align(ranges, type, alignment, cellDescriptor, propertySetter)

Parameters:
Name Type Description
ranges Array.<CellRange>

An array of the cell ranges.

type string

The type of the alignment axis ('horizontal' or 'vertical').

alignment string

CSS class name to add.

cellDescriptor function

The function which fetches the cell meta object based in passed coordinates.

propertySetter function

The function which contains logic for added/removed alignment.

applyAlignClassName(row, col, type, alignment, cellDescriptor, propertySetter)

Parameters:
Name Type Description
row number

The visual row index.

col number

The visual column index.

type string

The type of the alignment axis ('horizontal' or 'vertical').

alignment string

CSS class name to add.

cellDescriptor function

The function which fetches the cell meta object based in passed coordinates.

propertySetter function

The function which contains logic for added/removed alignment.

areValidSortStates(sortStates){boolean}

Get if all sorted columns states are valid.

Parameters:
Name Type Description
sortStates Array

The sort state collection.

Returns: {boolean}

arrayAvg(array){number}

Calculate average value for each item of the array.

Parameters:
Name Type Description
array Array

The array to process.

Returns: {number} Returns calculated average value.

arrayEach(array, iteratee){Array}

A specialized version of .forEach for arrays without support for callback
shorthands and this binding.

https://github.com/lodash/lodash/blob/master/lodash.js.

Parameters:
Name Type Description
array Array | *

The array to iterate over or an any element with implemented iterator protocol.

iteratee function

The function invoked per iteration.

Returns: {Array} Returns array.

arrayFilter(array, predicate){Array}

A specialized version of .filter for arrays without support for callback
shorthands and this binding.

https://github.com/lodash/lodash/blob/master/lodash.js.

Parameters:
Name Type Description
array Array

The array to iterate over.

predicate function

The function invoked per iteration.

Returns: {Array} Returns the new filtered array.

arrayFlatten(array){Array}

Flatten multidimensional array.

Parameters:
Name Type Description
array Array

Array of Arrays.

Returns: {Array}

arrayMap(array, iteratee){Array}

A specialized version of .map for arrays without support for callback
shorthands and this binding.

Parameters:
Name Type Description
array Array

The array to iterate over.

iteratee function

The function invoked per iteration.

Returns: {Array} Returns the new filtered array.

arrayMax(array){number}

Returns the highest value from an array. Can be array of numbers or array of strings.
NOTICE: Mixed values is not supported.

Parameters:
Name Type Description
array Array

The array to process.

Returns: {number} Returns the highest value from an array.

arrayMin(array){number}

Returns the lowest value from an array. Can be array of numbers or array of strings.
NOTICE: Mixed values is not supported.

Parameters:
Name Type Description
array Array

The array to process.

Returns: {number} Returns the lowest value from an array.

arrayReduce(array, iteratee, accumulator, initFromArray){*}

A specialized version of .reduce for arrays without support for callback
shorthands and this binding.

https://github.com/lodash/lodash/blob/master/lodash.js.

Parameters:
Name Type Description
array Array

The array to iterate over.

iteratee function

The function invoked per iteration.

accumulator * optional

The initial value.

initFromArray boolean optional

Specify using the first element of array as the initial value.

Returns: {*} Returns the accumulated value.

arraySum(array){number}

Calculate sum value for each item of the array.

Parameters:
Name Type Description
array Array

The array to process.

Returns: {number} Returns calculated sum value.

arrayUnique(array){Array}

Unique values in the array.

Parameters:
Name Type Description
array Array

The array to process.

Returns: {Array}

assert(condition, errorMessage)

Function which makes assertion by custom condition. Function throws an error when assertion doesn't meet the spec.

Parameters:
Name Type Description
condition function

Function with custom logic. The condition has to return boolean values.

errorMessage string

String which describes assertion error.

breadthFirst(callback, context)

Parameters:
Name Type Description
callback function

A callback which will be called on each visited node.

context *

A context to pass through.

buildLeaves(parentNode, columnIndex, headerLevel, extractionLength)

Builds leaves for specified tree node.

Parameters:
Name Type Default Description
parentNode TreeNode

A node to which the leaves applies.

columnIndex number

A visual column index.

headerLevel number

Currently processed header level.

extractionLength number 1 optional

Determines column extraction length for node children.

buildTree()

Builds trees based on SourceSettings class. Calling a method causes clearing the tree state built
from the previous call.

byValueBoxRootElement(){HTMLElement}

Returns: {HTMLElement}

byValueMultipleSelect(){BaseComponent}

Returns: {BaseComponent}

cancelAnimationFrame(id)

Polyfill for cancelAnimationFrame.

Parameters:
Name Type Description
id number

The request Id, generated by requestAnimationFrame.

cellCoordFactory(axis, defaultIndex){function}

Cell coordinates function factory.

Parameters:
Name Type Description
axis string

An axis name (row or column) which default index will be applied to.

defaultIndex number

Default index.

Returns: {function}

cellDecorator(instance, TD, row, col, prop, value, cellProperties)

Parameters:
Name Type Description
instance Core

The Handsontable instance.

TD HTMLTableCellElement

The rendered cell element.

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).

value *

The rendered value.

cellProperties object

The cell meta object ({@see Core#getCellMeta}).

checkSelectionBorders(hot, direction){boolean}

Check if selection has border.

Parameters:
Name Type Description
hot Core

The Handsontable instance.

direction string optional

If set ('left' or 'top') then only the specified border side will be checked.

Returns: {boolean}

checkSelectionConsistency(ranges, comparator){boolean}

Parameters:
Name Type Description
ranges Array.<CellRange>

An array of the cell ranges.

comparator function

The comparator function.

Returns: {boolean}

cleanPatches(patches){Array}

Clean and extend patches from jsonpatch observer.

Parameters:
Name Type Description
patches Array

The list of patches from jsonpatch lib to process.

Returns: {Array}

clear()

Clears the map.

clear()

Clears the column state manager to the initial state.

clear()

Clears the data.

clear()

Clears the tree to the initial state.

clearCache()

Clears all saved column meta objects.

clearCache()

Clears all saved cell and columns meta objects.

clearCache()

Clears all saved cell meta objects.

clearCellsCache()

Clears all saved cell meta objects. It keeps column meta, table meta, and global meta intact.

clearTextSelection(rootWindow)

Cross-platform helper to clear text selection.

Parameters:
Name Type Description
rootWindow Window optional

The document window owner.

clone(object){object}

Shallow clone object.

Parameters:
Name Type Description
object object

An object to clone.

Returns: {object}

closest(element, nodes, until){Node|null}

Goes up the DOM tree (including given element) until it finds an parent element that matches the nodes or nodes name.
This method goes up through web components.

Parameters:
Name Type Description
element Node

Element from which traversing is started.

nodes Array.<(string|Node)> optional

Array of elements or Array of elements name (in uppercase form).

until Node optional

The element until the traversing ends.

Returns: {Node|null}

closestDown(element, nodes, until){HTMLElement|null}

Goes "down" the DOM tree (including given element) until it finds an element that matches the nodes or nodes name.

Parameters:
Name Type Description
element HTMLElement

Element from which traversing is started.

nodes Array

Array of elements or Array of elements name.

until HTMLElement optional

The list of elements until the traversing ends.

Returns: {HTMLElement|null}

columnFactory(TableMeta, conflictList){ColumnMeta}

Creates new class which extends properties from TableMeta layer class.

Parameters:
Name Type Description
TableMeta TableMeta

The TableMeta which the new ColumnMeta is created from.

conflictList Array.<string> optional

List of the properties which are conflicted with the column meta layer.
Conflicted properties are overwritten by undefined value, to separate them
from the TableMeta layer.

Returns: {ColumnMeta} Returns constructor ready to initialize with new operator.

compareFunctionFactory(sortOrder, columnMeta, columnPluginSettings){function}

Default sorting compare function factory. Method get as parameters sortOrder and columnMeta and return compare function.

Parameters:
Name Type Description
sortOrder string

Sort order (asc for ascending, desc for descending).

columnMeta object

Column meta object.

columnPluginSettings object

Plugin settings for the column.

Returns: {function} The compare function.

compareFunctionFactory(sortOrder, columnMeta, columnPluginSettings){function}

Numeric sorting compare function factory. Method get as parameters sortOrder and columnMeta and return compare function.

Parameters:
Name Type Description
sortOrder string

Sort order (asc for ascending, desc for descending).

columnMeta object

Column meta object.

columnPluginSettings object

Plugin settings for the column.

Returns: {function} The compare function.

compareFunctionFactory(sortOrder, columnMeta, columnPluginSettings){function}

Date sorting compare function factory. Method get as parameters sortOrder and columnMeta and return compare function.

Parameters:
Name Type Description
sortOrder string

Sort order (asc for ascending, desc for descending).

columnMeta object

Column meta object.

columnPluginSettings object

Plugin settings for the column.

Returns: {function} The compare function.

condition(dataRow, inputValues){boolean}

Parameters:
Name Type Description
dataRow object

The object which holds and describes the single cell value.

inputValues Array

An array of values to compare with.

Returns: {boolean}

condition(dataRow, inputValues){boolean}

Parameters:
Name Type Description
dataRow object

The object which holds and describes the single cell value.

inputValues Array

An array of values to compare with.

Returns: {boolean}

condition(){boolean}

Returns: {boolean}

condition(dataRow, inputValues){boolean}

Parameters:
Name Type Description
dataRow object

The object which holds and describes the single cell value.

inputValues Array

An array of values to compare with.

Returns: {boolean}

condition(dataRow, inputValues){boolean}

Parameters:
Name Type Description
dataRow object

The object which holds and describes the single cell value.

inputValues Array

An array of values to compare with.

Returns: {boolean}

condition(dataRow, inputValues){boolean}

Parameters:
Name Type Description
dataRow object

The object which holds and describes the single cell value.

inputValues Array

An array of values to compare with.

Returns: {boolean}

condition(dataRow, inputValues){boolean}

Parameters:
Name Type Description
dataRow object

The object which holds and describes the single cell value.

inputValues Array

An array of values to compare with.

Returns: {boolean}

condition(dataRow, inputValues){boolean}

Parameters:
Name Type Description
dataRow object

The object which holds and describes the single cell value.

inputValues Array

An array of values to compare with.

Returns: {boolean}

condition(dataRow, inputValues){boolean}

Parameters:
Name Type Description
dataRow object

The object which holds and describes the single cell value.

inputValues Array

An array of values to compare with.

Returns: {boolean}

condition(dataRow, inputValues){boolean}

Parameters:
Name Type Description
dataRow object

The object which holds and describes the single cell value.

inputValues Array

An array of values to compare with.

Returns: {boolean}

condition(dataRow, inputValues){boolean}

Parameters:
Name Type Description
dataRow object

The object which holds and describes the single cell value.

inputValues Array

An array of values to compare with.

Returns: {boolean}

condition(){boolean}

Returns: {boolean}

condition(dataRow, inputValues){boolean}

Parameters:
Name Type Description
dataRow object

The object which holds and describes the single cell value.

inputValues Array

An array of values to compare with.

Returns: {boolean}

condition(dataRow, inputValues){boolean}

Parameters:
Name Type Description
dataRow object

The object which holds and describes the single cell value.

inputValues Array

An array of values to compare with.

Returns: {boolean}

condition(dataRow){boolean}

Parameters:
Name Type Description
dataRow object

The object which holds and describes the single cell value.

Returns: {boolean}

condition(dataRow){boolean}

Parameters:
Name Type Description
dataRow object

The object which holds and describes the single cell value.

Returns: {boolean}

condition(dataRow, inputValues){boolean}

Parameters:
Name Type Description
dataRow object

The object which holds and describes the single cell value.

inputValues Array

An array of values to compare with.

Returns: {boolean}

condition(){boolean}

Returns: {boolean}

condition(dataRow){boolean}

Parameters:
Name Type Description
dataRow object

The object which holds and describes the single cell value.

Returns: {boolean}

condition(dataRow, inputValues){boolean}

Parameters:
Name Type Description
dataRow object

The object which holds and describes the single cell value.

inputValues Array

An array of values to compare with.

Returns: {boolean}

condition(dataRow, inputValues){boolean}

Parameters:
Name Type Description
dataRow object

The object which holds and describes the single cell value.

inputValues Array

An array of values to compare with.

Returns: {boolean}

condition(dataRow, inputValues){boolean}

Parameters:
Name Type Description
dataRow object

The object which holds and describes the single cell value.

inputValues Array

An array of values to compare with.

Returns: {boolean}

condition(dataRow){boolean}

Parameters:
Name Type Description
dataRow object

The object which holds and describes the single cell value.

Returns: {boolean}

conditionFactory(funcForCall){function}

Parameters:
Name Type Description
funcForCall function

The function with custom condition.

Returns: {function}

conditionMenuRootElements(){object}

Returns: {object}

conditionRadioInput(index){HTMLElement}

Parameters:
Name Type Description
index number

The 0-based index, which tells what input element we want to retrieve.

Returns: {HTMLElement}

conditionSelectRootElements(){object}

Returns: {object}

correctFormat(value, dateFormat){string}

Format the given string using moment.js' format feature.

Parameters:
Name Type Description
value string

The value to format.

dateFormat string

The date pattern to format to.

Returns: {string}

createArrayAssertion(initialData){function}

Create an array assertion to compare if an element exists in that array (in a more efficient way than .indexOf).

Parameters:
Name Type Description
initialData Array

Values to compare.

Returns: {function}

createCellHeadersRange(firstRowIndex, nextRowIndex, fromValue, toValue){string}

Create range of values basing on cell indexes. For example, it will create below ranges for specified function arguments:

createCellHeadersRange(2, 7) => 2-7
createCellHeadersRange(7, 2) => 2-7
createCellHeadersRange(0, 4, 'A', 'D') => A-D
createCellHeadersRange(4, 0, 'D', 'A') => A-D.

Parameters:
Name Type Description
firstRowIndex number

Index of "first" cell.

nextRowIndex number

Index of "next" cell.

fromValue *

Value which will represent "first" cell.

toValue *

Value which will represent "next" cell.

Returns: {string} Value representing range i.e. A-Z, 11-15.

createColumn(physicalColumn, amount)

Creates one or more columns at specific position.

Parameters:
Name Type Description
physicalColumn number

The physical column index which points from what position the column is added.

amount number

An amount of columns to add.

createColumn(physicalColumn, amount)

Creates one or more columns at specific position.

Parameters:
Name Type Description
physicalColumn number

The physical column index which points from what position the column is added.

amount number

An amount of columns to add.

createColumn(physicalColumn, amount)

Creates one or more columns at specific position.

Parameters:
Name Type Default Description
physicalColumn number

The physical column index which points from what position the column is added.

amount number 1 optional

An amount of columns to add.

createDefaultCustomBorder(){object}

Create default single border for each position (top/right/bottom/left).

Returns: {object} {{width: number, color: string}}.

createDefaultHtBorder(){object}

Create default Handsontable border object.

Returns: {object} {{width: number, color: string, cornerVisible: boolean}}.

createElement(container){FocusableWrapper}

Create and return the FocusableWrapper instance.

Parameters:
Name Type Description
container HTMLElement

The container element, holder for focusable elements.

Returns: {FocusableWrapper}

createEmptyBorders(row, col){object}

Prepare empty border for each cell with all custom borders hidden.

Parameters:
Name Type Description
row number

Visual row index.

col number

Visual column index.

Returns: {object} Returns border configuration containing visual indexes. Example of an object defining it:
{{id: *, border: *, row: *, col: *, top: {hide: boolean}, right: {hide: boolean}, bottom: {hide: boolean}, left: {hide: boolean}}}.

createHighlight(){Selection}

Creates the new instance of Selection responsible for highlighting area of the selected multiple cells.

Returns: {Selection}

createHighlight(){Selection}

Creates the new instance of Selection, responsible for highlighting row and column headers. This type of selection
can occur multiple times.

Returns: {Selection}

createHighlight(){Selection}

Returns: {Selection}

createHighlight(){Selection}

Creates the new instance of Selection responsible for highlighting currently selected cell. This type of selection
can present on the table only one at the time.

Returns: {Selection}

createHighlight(highlightType, options){Selection}

Parameters:
Name Type Description
highlightType string

The selection type.

options object

The selection options.

Returns: {Selection}

createHighlight(){Selection}

Creates the new instance of Selection responsible for highlighting currently selected cell. This type of selection
can present on the table only one at the time.

Returns: {Selection}

createHighlight(){Selection}

Creates the new instance of Selection, responsible for highlighting cells which are covered by fill handle
functionality. This type of selection can present on the table only one at the time.

Returns: {Selection}

createId(row, col){string}

Create separated id for borders for each cell.

Parameters:
Name Type Description
row number

Visual row index.

col number

Visual column index.

Returns: {string}

createInput(rootDocument){Node}

Create input element.

Parameters:
Name Type Description
rootDocument Document

The document owner.

Returns: {Node}

createLabel(rootDocument, text){Node}

Create label element.

Parameters:
Name Type Description
rootDocument Document

The document owner.

text string

The label text.

Returns: {Node}

createNestedArrayIfNecessary(array, index){Array}

Internal helper which ensures that subarray exists under specified index.

Parameters:
Name Type Description
array Array.<Array>

An array to check.

index number

An array index under the subarray should be checked.

Returns: {Array}

createObjectPropListener(defaultValue, propertyToListen){object}

Create object with property where its value change will be observed.

Parameters:
Name Type Default Description
defaultValue * optional

Default value.

propertyToListen string &#39value&#39 optional

Property to listen.

Returns: {object}

createOrGetSecondaryElement(container){HTMLElement}

Create and attach newly created focusable element to the DOM.

Parameters:
Name Type Description
container HTMLElement

The container element, holder for focusable elements.

Returns: {HTMLElement}

createRow(physicalRow, amount)

Creates one or more rows at specific position.

Parameters:
Name Type Description
physicalRow number

The physical row index which points from what position the row is added.

amount number

An amount of rows to add.

createRow(physicalRow, amount)

Creates one or more rows at specific position.

Parameters:
Name Type Default Description
physicalRow number

The physical row index which points from what position the row is added.

amount number 1 optional

An amount of rows to add.

createSingleEmptyBorder(){object}

Create default object for empty border.

Returns: {object} {{hide: boolean}}.

createTableMetaEmptyClass(){TableMeta}

Returns: {TableMeta} Returns an empty object. The holder for global meta object.

curry(func){function}

Creates the functions that returns the function with cached arguments. If count if passed arguments will be matched
to the arguments defined in func then function will be invoked.
Arguments are added to the stack in direction from the left to the right.

Parameters:
Name Type Description
func function

Function to currying.

Returns: {function}
Example
var replace = curry(function(find, replace, string) {
  return string.replace(find, replace);
});

// returns function with bounded first argument
var replace = replace('foo')

// returns replaced string - all arguments was passed so function was invoked
replace('bar', 'Some test with foo...');

curryRight(func){function}

Creates the functions that returns the function with cached arguments. If count if passed arguments will be matched
to the arguments defined in func then function will be invoked.
Arguments are added to the stack in direction from the right to the left.

Parameters:
Name Type Description
func function

Function to currying.

Returns: {function}
Example
var replace = curry(function(find, replace, string) {
  return string.replace(find, replace);
});

// returns function with bounded first argument
var replace = replace('Some test with foo...')

// returns replaced string - all arguments was passed so function was invoked
replace('bar', 'foo');

customTranslateModifier(cell, axis, delta, startFromIndex){Array}

Parameters:
Name Type Description
cell cellCoord

The cell coordinates.

axis string

The axis defined as "row" or "column".

delta number

The shift/delta betwen old and new position.

startFromIndex number

The index from the operation was performed.

Returns: {Array}

customTranslateModifier(cell, axis, delta, startFromIndex){Array}

Parameters:
Name Type Description
cell cellCoord

The cell coordinates.

axis string

The axis defined as "row" or "column".

delta number

The shift/delta betwen old and new position.

startFromIndex number

The index from the operation was performed.

Returns: {Array}

customTranslateModifier(cell, axis, delta, startFromIndex){Array}

Parameters:
Name Type Description
cell cellCoord

The cell coordinates.

axis string

The axis defined as "row" or "column".

delta number

The shift/delta betwen old and new position.

startFromIndex number

The index from the operation was performed.

Returns: {Array}

customTranslateModifier(cell, axis, delta, startFromIndex){Array}

Parameters:
Name Type Description
cell cellCoord

The cell coordinates.

axis string

The axis defined as "row" or "column".

delta number

The shift/delta betwen old and new position.

startFromIndex number

The index from the operation was performed.

Returns: {Array}

dateRowFactory(meta){function}

Parameters:
Name Type Description
meta object

The cell meta object.

Returns: {function}

deactivateElement(wrapper)

Deactivate the FocusableWrapper instance.

Parameters:
Name Type Description
wrapper FocusableWrapper

The instance of the FocusableWrapper class.

debounce(func, wait){function}

Creates debounce function that enforces a function (func) not be called again until a certain amount of time (wait)
has passed without it being called.

Parameters:
Name Type Description
func function

Function to invoke.

wait number

Delay in milliseconds.

Returns: {function}

deepClone(obj){object}

Perform deep clone of an object.
WARNING! Only clones JSON properties. Will cause error when obj contains a function, Date, etc.

Parameters:
Name Type Description
obj object

An object that will be cloned.

Returns: {object}

deepExtend(target, extension)

Perform deep extend of a target object with extension's own properties.

Parameters:
Name Type Description
target object

An object that will receive the new properties.

extension object

An object containing additional properties to merge into the target.

deepObjectSize(object){number}

Return object length (recursively).

Parameters:
Name Type Description
object *

Object for which we want get length.

Returns: {number}

defaultCompareFunction(a, b){number}

Specifies a function that defines the sort order. The array is sorted according to each
character's Unicode code point value, according to the string conversion of each element.

Parameters:
Name Type Description
a *

The first compared element.

b *

The second compared element.

Returns: {number}

defineGetter(object, property, value, options)

Parameters:
Name Type Description
object object

The object on which to define the property.

property string

The name of the property to be defined or modified.

value *

The value associated with the property.

options object

The descriptor for the property being defined or modified.

depthFirstPostOrder(callback, context){boolean}

Parameters:
Name Type Description
callback function

A callback which will be called on each visited node.

context *

A context to pass through.

Returns: {boolean}

depthFirstPreOrder(callback, context){boolean}

Parameters:
Name Type Description
callback function

A callback which will be called on each visited node.

context *

A context to pass through.

Returns: {boolean}

destroyElement(wrapper)

Destroy the FocusableWrapper instance.

Parameters:
Name Type Description
wrapper FocusableWrapper

The instance of the FocusableWrapper class.

detectCaptionProblem()

detectSelectionType(selectionRanges, _callSymbol){number}

Detect selection schema structure.

Parameters:
Name Type Description
selectionRanges *

The selected range or and array of selected ranges. This type of data is produced by
hot.getSelected(), hot.getSelectedLast(), hot.getSelectedRange()
and hot.getSelectedRangeLast() methods.

_callSymbol symbol

The symbol object which indicates source of the helper invocation.

Returns: {number} Returns a number that specifies the type of detected selection schema. If selection schema type
is unrecognized than it returns 0.

displayAPICompatibilityWarning(beforeMoveRowHookArgs){boolean}

Display a dragRows/moveRows method compatibility warning if needed.

Parameters:
Name Type Description
beforeMoveRowHookArgs object

A set of arguments from the beforeMoveRow hook.

Returns: {boolean} true if is a result of an improper usage of the moving API.

duckSchema(object){Array|object}

Generate schema for passed object.

Parameters:
Name Type Description
object Array | object

An object to analyze.

Returns: {Array|object}

empty(element)

Remove childs function
WARNING - this doesn't unload events and data attached by jQuery
http://jsperf.com/jquery-html-vs-empty-vs-innerhtml/9
http://jsperf.com/jquery-html-vs-empty-vs-innerhtml/11 - no siginificant improvement with Chrome remove() method.

Parameters:
Name Type Description
element HTMLElement

An element to clear.

entries(){Iterator}

Returns a new Iterator object that contains an array of [index, value] for each item in the LazyMap object.

Returns: {Iterator}

equalsIgnoreCase(strings){boolean}

Compare strings case insensitively.

Parameters:
Name Type Description
strings string repeatable

Strings to compare.

Returns: {boolean}

error(args)

Logs error to the console if the console object is exposed.

Parameters:
Name Type Description
args * repeatable

Values which will be logged.

expandMetaType(type, metaObject){object|undefined}

Expands "type" property of the meta object to single values. For example type: 'numeric' sets
"renderer", "editor", "validator" properties to specific functions designed for numeric values.
If "type" is passed as an object that object will be returned, excluding properties that
already exist in the "metaObject" if passed.

Parameters:
Name Type Description
type object | string

Type to expand;.

metaObject object | undefined optional

Source meta object.

Returns: {object|undefined}

exposeUndoRedoMethods(instance)

Parameters:
Name Type Description
instance Core

The Handsontable instance.

extend(target, extension, writableKeys){object}

Perform shallow extend of a target object with extension's own properties.

Parameters:
Name Type Description
target object

An object that will receive the new properties.

extension object

An object containing additional properties to merge into the target.

writableKeys Array.<string> optional

An array of keys that are writable to target object.

Returns: {object}

extendArray(arr, extension)

Parameters:
Name Type Description
arr Array

An array to extend.

extension Array

The data to extend from.

extendDefaultBorder(defaultBorder, customBorder){object}

Parameters:
Name Type Description
defaultBorder object

The default border object.

customBorder object

The border object with custom settings.

Returns: {object}

extendNotExistingKeys(target, extension){object}

Perform shallow extend of a target object with only this extension's properties which doesn't exist in the target.

TODO: Maybe it should be moved to global helpers? It's changed extend function.

Parameters:
Name Type Description
target object

An object that will receive the new properties.

extension object

An object containing additional properties to merge into the target.

Returns: {object}

fastInnerHTML(element, content)

Insert content into element trying avoid innerHTML method.

Parameters:
Name Type Description
element HTMLElement

An element to write into.

content string

The text to write.

fastInnerText(element, content)

Insert text content into element.

Parameters:
Name Type Description
element HTMLElement

An element to write into.

content string

The text to write.

filterEmptyClassNames(classNames){Array.<string>}

Parameters:
Name Type Description
classNames string

The element "class" attribute string.

Returns: {Array.<string>}

filterSeparators(items, separator){Array.<object>}

Removes menu separators from the context menu items collection.

Parameters:
Name Type Description
items Array.<object>

The context menu items collection.

separator string

The string which identifies the context menu separator item.

Returns: {Array.<object>}

findLeftMostColumnIndex(headerLevel, columnIndex){number}

The method is helpful in cases where the column index targets in-between currently
collapsed column. In that case, the method returns the left-most column index
where the nested header begins.

Parameters:
Name Type Description
headerLevel number

Header level (there is support for negative and positive values).

columnIndex number

A visual column index.

Returns: {number}

findSubCommand(subCommandName, subCommands){boolean}

Parameters:
Name Type Description
subCommandName string

The subcommand name.

subCommands Array.<string>

The collection of the commands.

Returns: {boolean}

forwardEventsToLocalHooks(eventManager, element, subject)

Register copy/cut/paste events and forward their actions to the subject local hooks system.

Parameters:
Name Type Description
eventManager EventManager

The instance of the EventManager class.

element HTMLElement

The element on which the listeners are mounted.

subject FocusableWrapper

The subject object for local hooks.

generateMatrix(headerRoots){Array.<Array>}

A function that dump a tree structure into multidimensional array. That structure is
later processed by header renderers to modify TH elements to achieve a proper
DOM structure.

That structure contains settings object for every TH element generated by Walkontable.
The matrix operates on visual column index.

Output example:
[
[
{ label: 'A1', colspan: 2, origColspan: 2, isHidden: false, ... },
{ label: '', colspan: 1, origColspan: 1, isHidden: true, ... },
{ label: '', colspan: 1, origColspan: 1, isHidden: false, ... },
],
[
{ label: 'true', colspan: 1, origColspan: 1, isHidden: false, ... },
{ label: 'B2', colspan: 1, origColspan: 1, isHidden: false, ... },
{ label: '4', colspan: 1, origColspan: 1, isHidden: false, ... },
],
[
{ label: '', colspan: 1, origColspan: 1, isHidden: false, ... },
{ label: '', colspan: 1, origColspan: 1, isHidden: false, ... },
{ label: '', colspan: 1, origColspan: 1, isHidden: false, ... },
],
]

Parameters:
Name Type Description
headerRoots Array.<TreeNode>

An array of root nodes.

Returns: {Array.<Array>}

getAlignmentClasses(ranges, callback){object}

Parameters:
Name Type Description
ranges Array.<CellRange>

An array of the cell ranges.

callback function

The callback function.

Returns: {object}

getAll(){Array}

Get all registered previously formatters.

Returns: {Array}

getBaseParent(physicalStartIndexes){object|null}

Get the base row parent.

Parameters:
Name Type Description
physicalStartIndexes number

Physical start row index.

Returns: {object|null} The base row parent.

getCaretPosition(el){number}

Returns caret position in text input.

Parameters:
Name Type Description
el HTMLElement

An element to check.

Author:
  • https://stackoverflow.com/questions/263743/how-to-get-caret-position-in-textarea
Returns: {number}

getCellMeta(physicalRow, physicalColumn, key){object}

Gets the cell meta object that is a root of all settings defined for the specific cell rendered by
the Handsontable. Each cell meta inherits settings from higher layers. When a property doesn't
exist in that layer, it is looked up through a prototype to the highest layer. Starting
from CellMeta -> ColumnMeta and ending to GlobalMeta, which stores default settings. Adding,
removing, or changing property in that object has no direct reflection on any other layers.

Parameters:
Name Type Description
physicalRow number

The physical row index.

physicalColumn number

The physical column index.

key string optional

If the key exists its value will be returned, otherwise the whole cell meta object.

Returns: {object}

getCellsMeta(){Array.<object>}

Returns all cell meta objects that were created during the Handsontable operation. As cell meta
objects are created lazy, the length of the returned collection depends on how and when the
table has asked for access to that meta objects.

Returns: {Array.<object>}

getCellsMetaAtRow(physicalRow){Array.<object>}

Returns all cell meta objects that were created during the Handsontable operation but for
specyfic row index.

Parameters:
Name Type Description
physicalRow number

The physical row index.

Returns: {Array.<object>}

getClassedToRemove(htmlElement){Array}

Get CSS classes which should be removed from column header.

Parameters:
Name Type Description
htmlElement HTMLElement

An element to process.

Returns: {Array} Array of CSS classes.

getClassedToRemove(){Array}

Get CSS classes which should be removed from column header.

Returns: {Array} Array of CSS classes.

getClassesToAdd(columnStatesManager, column, showSortIndicator){Array}

Get CSS classes which should be added to particular column header.

Parameters:
Name Type Description
columnStatesManager object

Instance of column state manager.

column number

Physical column index.

showSortIndicator boolean

Indicates if indicator should be shown for the particular column.

Returns: {Array} Array of CSS classes.

getClassesToAdd(columnStatesManager, column, showSortIndicator, headerAction){Array}

Get CSS classes which should be added to particular column header.

Parameters:
Name Type Description
columnStatesManager object

Instance of column state manager.

column number

Physical column index.

showSortIndicator boolean

Indicates if indicator should be shown for the particular column.

headerAction boolean

Indicates if header click to sort should be possible.

Returns: {Array} Array of CSS classes.

getColumnMeta(physicalColumn){object}

Gets column meta object that is a root of all settings defined in the column property of the Handsontable
settings. Each column in the Handsontable is associated with a unique meta object which identified by
the physical column index. Adding, removing, or changing property in that object has a direct reflection
only for the CellMeta layer. The reflection will be visible only if the property doesn't exist in the lower
layers (prototype lookup).

Parameters:
Name Type Description
physicalColumn number

The physical column index.

Returns: {object}

getColumnsCount(){number}

Gets a total number of columns count.

Returns: {number}

getColumnsCount(){number}

Gets a total number of columns count.

Returns: {number}

getColumnsForFilters(){Array.<object>}

Returns: {Array.<object>}

getColumnsForFormulas(){Array.<object>}

Returns: {Array.<object>}

getCompareFunctionFactory(type){function}

Gets sort function for the particular column basing on it's data type.

Parameters:
Name Type Description
type string

The data type.

Returns: {function}

getComparisonFunction(language, options){*}

Get string comparison function for sorting purposes. It supports multilingual string comparison base on Internationalization API.

Parameters:
Name Type Description
language string optional

The language code used for phrases sorting.

options object optional

Additional options for sort comparator.

Returns: {*}

getComputedStyle(element, rootWindow){IEElementStyle|CssStyle}

Returns a computed style object for the provided element. (Needed if style is declared in external stylesheet).

Parameters:
Name Type Description
element HTMLElement

An element to get style from.

rootWindow Window optional

The document window owner.

Returns: {IEElementStyle|CssStyle} Elements computed style object.

getCondition(name, args){function}

Get condition closure with pre-bound arguments.

Parameters:
Name Type Description
name string

Condition name.

args Array

Condition arguments.

Returns: {function}

getConditionDescriptor(name){object}

Get condition object descriptor which defines some additional informations about this condition.

Parameters:
Name Type Description
name string

Condition name.

Returns: {object}

getCssTransform(element){number|Array}

Parameters:
Name Type Description
element HTMLElement

An element to process.

Returns: {number|Array}

getData(){Array.<Array>}

Gets normalized source settings.

Returns: {Array.<Array>}

getDataAdvancedExampleFormulas(){Array.<Array>}

Returns: {Array.<Array>}

getDataForColumnSummary(){Array.<object>}

Returns: {Array.<object>}

getDataForFilters(){Array.<object>}

Returns: {Array.<object>}

getDataForFormulas(row, column, value){Array.<object>}

Returns fixed length dataset which can be extended.

Parameters:
Name Type Description
row number

The row index from the "value" argument will injected.

column number

The column index from the "value" argument will injected.

value Array

The value that overwrites the dataset.

Returns: {Array.<object>}

getDataSimpleExampleFormulas(){Array.<Array>}

Returns: {Array.<Array>}

getDefaultLanguage(){object}

Get default language dictionary.

Returns: {object} Object with constants representing identifiers for translation (as keys) and corresponding translation phrases (as values).

getDeltas(start, end, data, direction){Array}

Get deltas array.

Parameters:
Name Type Description
start CellCoords

The point in the grid where the selection starts.

end CellCoords

The point in the grid where the selection ends.

data Array

The chunk of the data which belongs to the selected box.

direction string

The selection direction.

Returns: {Array}

getDifferenceOfArrays(arrays){Array}

Differences from two or more arrays.

Parameters:
Name Type Description
arrays Array repeatable

Array of strings or array of numbers.

Returns: {Array} Returns the difference between arrays.

getDragDirectionAndRange(startSelection, endSelection){Object}

Get direction between positions and cords of selections difference (drag area).

Parameters:
Name Type Description
startSelection Array

The coordinates where the selection starts.

endSelection Array

The coordinates where the selection ends.

Returns: {Object}

getFirstChildProperty(node, propertyName){*}

A tree helper for retrieving a data from the first child.

Parameters:
Name Type Description
node TreeNode

A tree node to check.

propertyName string

A name of the property whose value you want to get.

Returns: {*}

getFrameElement(frame){HTMLIFrameElement|null}

Gets frameElement of the specified frame. Returns null if it is a top frame or if script has no access to read property.

Parameters:
Name Type Description
frame Window

Frame from which should be get frameElement in safe way.

Returns: {HTMLIFrameElement|null}

getGlobalMeta(){object}

Gets the global meta object that is a root of all default settings, which are recognizable by Handsontable.
Other layers inherites all properties from this. Adding, removing, or changing property in that
object has a direct reflection to all layers.

Returns: {object}

getGlobalSingleton(){Hooks}

Returns: {Hooks}

getHeaderSettings(headerLevel, columnIndex){object}

Gets column header settings for a specified column and header index. The returned object contains
all information necessary for header renderers. It contains header label, colspan length, or hidden
flag.

Parameters:
Name Type Description
headerLevel number

Header level (there is support for negative and positive values).

columnIndex number

A visual column index.

Returns: {object}

getHeaderSettings(headerLevel, columnIndex){object|null}

Gets source column header settings for a specified header. The returned
object contains information about the header label, its colspan length,
or if it is hidden in the header renderers.

Parameters:
Name Type Description
headerLevel number

Header level (0 = most distant to the table).

columnIndex number

A visual column index.

Returns: {object|null}

getHeaderSpanElement(TH){Element|null}

Get span DOM element inside th DOM element.

Parameters:
Name Type Description
TH Element

Th HTML element.

Returns: {Element|null}

getHeadersSettings(headerLevel, columnIndex, columnsLength){object}

Gets source of column headers settings for specified headers. If the retrieved column
settings overlap the range "box" determined by "columnIndex" and "columnsLength"
the exception will be thrown.

Parameters:
Name Type Default Description
headerLevel number

Header level (0 = most distant to the table).

columnIndex number

A visual column index from which the settings will be extracted.

columnsLength number 1 optional

The number of columns involved in the extraction of settings.

Returns: {object}

getIntersectionOfArrays(arrays){Array}

Intersection of two or more arrays.

Parameters:
Name Type Description
arrays Array repeatable

Array of strings or array of numbers.

Returns: {Array} Returns elements that exists in every array.

getItems(itemsPattern, defaultPattern, items){Array.<object>}

Parameters:
Name Type Default Description
itemsPattern Array.<object>

The user defined menu items collection.

defaultPattern Array.<object>

The menu default items collection.

items object

Additional options.

Returns: {Array.<object>} Returns parsed and merged menu items collection ready to render.

getLanguage(languageCode){object}

Get language dictionary for specific language code.

Parameters:
Name Type Description
languageCode string

Language code.

Returns: {object} Object with constants representing identifiers for translation (as keys) and corresponding translation phrases (as values).

getLanguages(){Array}

Get registered language dictionaries.

Returns: {Array}

getLayersCount(){number}

Gets a total number of headers levels.

Returns: {number}

getLayersCount(){number}

Gets a total number of headers levels.

Returns: {number}

getListenersCounter(){number}

Returns: {number}

getMappedFillHandleSetting(fillHandle){Object}

Get mapped FillHandle setting containing information about
allowed FillHandle directions and if allowed is automatic insertion of rows on drag.

Parameters:
Name Type Description
fillHandle boolean | object

Property of Handsontable settings.

Returns: {Object} Object allowing access to information
about FillHandle in more useful way.

getMeta(){object}

Gets settings object for this layer.

Returns: {object}

getMeta(){object}

Gets settings object for this layer.

Returns: {object}

getMeta(physicalColumn){object}

Gets settings object for this layer.

Parameters:
Name Type Description
physicalColumn number

The physical column index.

Returns: {object}

getMeta(physicalRow, physicalColumn, key){object}

Gets settings object for this layer.

Parameters:
Name Type Description
physicalRow number

The physical row index.

physicalColumn number

The physical column index.

key string optional

If the key exists its value will be returned, otherwise the whole cell meta object.

Returns: {object}

getMetaConstructor(physicalColumn){function}

Gets constructor of the column meta object. Necessary for inheritance - creating the next meta layers.

Parameters:
Name Type Description
physicalColumn number

The physical column index.

Returns: {function}

getMetaConstructor(){function}

Gets constructor of the global meta object. Necessary for inheritance for creating the next meta layers.

Returns: {function}

getMetas(){Array.<object>}

Returns all cell meta objects that were created during the Handsontable operation. As cell meta
objects are created lazy, the length of the returned collection depends on how and when the
table has asked for access to that meta objects.

Returns: {Array.<object>}

getMetasAtRow(physicalRow){Array.<object>}

Returns all cell meta objects that were created during the Handsontable operation but for
specyfic row index.

Parameters:
Name Type Description
physicalRow number

The physical row index.

Returns: {Array.<object>}

getMoreComplexNestedData(){Array.<object>}

Returns: {Array.<object>}

getNextSortOrder(sortOrder){string|undefined}

Get next sort order for particular column. The order sequence looks as follows: 'asc' -> 'desc' -> undefined -> 'asc'.

Parameters:
Name Type Description
sortOrder string | undefined

Sort order (asc for ascending, desc for descending and undefined for not sorted).

Returns: {string|undefined} Next sort order (asc for ascending, desc for descending and undefined for not sorted).

getNode(headerLevel, columnIndex){TreeNode|undefined}

Gets a tree node by its position in the grid settings.

Parameters:
Name Type Description
headerLevel number

Header level index (there is support only for positive values).

columnIndex number

A visual column index.

Returns: {TreeNode|undefined}

getNormalizedDate(dateString){Date}

Get normalized Date object for the ISO formatted date strings.
Natively, the date object parsed from a ISO 8601 string will be offsetted by the timezone difference, which may result in returning a wrong date.
See: Github issue #3338.

Parameters:
Name Type Description
dateString string

String representing the date.

Returns: {Date} The proper Date object.

getOperationFunc(id){function}

Get operation closure with pre-bound arguments.

Parameters:
Name Type Description
id string

Operator id.

Returns: {function}

getOperationName(id){string}

Return name of operation which is displayed inside UI component, basing on it's id.

Parameters:
Name Type Description
id string

Id of operation.

Returns: {string}

getParent(element, level){HTMLElement|null}

Get the parent of the specified node in the DOM tree.

Parameters:
Name Type Default Description
element HTMLElement

Element from which traversing is started.

level number 0 optional

Traversing deep level.

Returns: {HTMLElement|null}

getParentWindow(frame){Window|null}

Gets parent frame of the specified frame. Returns null if it is a top frame or if script has no access to read property.

Parameters:
Name Type Description
frame Window

Frame from which should be get frameElement in safe way.

Returns: {Window|null}

getPlugin(instance, pluginName){function}

Parameters:
Name Type Description
instance Core

The Handsontable instance.

pluginName string

The plugin name.

Returns: {function} PluginClass Returns plugin instance if exists or undefined if not exists.

getPluginName(hotInstance, plugin){string|null}

Get plugin name.

Parameters:
Name Type Description
hotInstance Core

The Handsontable instance.

plugin BasePlugin

The plugin instance.

Returns: {string|null}

getProperty(object, name){*}

Get object property by its name. Access to sub properties can be achieved by dot notation (e.q. 'foo.bar.baz').

Parameters:
Name Type Description
object object

Object which value will be exported.

name string

Object property name.

Returns: {*}

getRegisteredMapsCounter(){number}

Returns: {number}

getRegistredPluginNames(hotInstance){Array}

Get all registred plugins names for concrete Handsontable instance.

Parameters:
Name Type Description
hotInstance Core

The Handsontable instance.

Returns: {Array}

getRootByColumn(columnIndex){TreeNode|undefined}

Gets a root node by specified visual column index.

Parameters:
Name Type Description
columnIndex number

A visual column index.

Returns: {TreeNode|undefined}

getRoots(){Array.<TreeNode>}

Gets an array of the all root nodes.

Returns: {Array.<TreeNode>}

getScrollableElement(element){HTMLElement}

Returns a DOM element responsible for scrolling of the provided element.

Parameters:
Name Type Description
element HTMLElement

An element to get the scrollable element from.

Returns: {HTMLElement} Element's scrollable parent.

getScrollbarWidth(rootDocument){number}

Returns the computed width of the native browser scroll bar.

Parameters:
Name Type Description
rootDocument Document optional

The owner of the document.

Returns: {number} Width.

getScrollLeft(element, rootWindow){number}

Returns the provided element's scrollLeft property.

Parameters:
Name Type Description
element HTMLElement

An element to get the scroll left position from.

rootWindow Window optional

The document window owner.

Returns: {number}

getScrollTop(element, rootWindow){number}

Returns the provided element's scrollTop property.

Parameters:
Name Type Description
element HTMLElement

An element to get the scroll top position from.

rootWindow Window optional

The document window owner.

Returns: {number}

getSelectionEndPosition(el){number}

Returns end of the selection in text input.

Parameters:
Name Type Description
el HTMLElement

An element to check.

Returns: {number}

getSelectionText(rootWindow){string}

Returns text under selection.

Parameters:
Name Type Description
rootWindow Window optional

The document window owner.

Returns: {string}

getSimplerNestedData(){Array.<object>}

Returns: {Array.<object>}

getStyle(element, prop, rootWindow){string|undefined}

Returns a style property for the provided element. (Be it an inline or external style).

Parameters:
Name Type Description
element HTMLElement

An element to get the style from.

prop string

Wanted property.

rootWindow Window optional

The document window owner.

Returns: {string|undefined} Element's style property.

getTableMeta(){object}

Gets settings object that was passed in the Handsontable constructor. That layer contains all
default settings inherited from the GlobalMeta layer merged with settings passed by the developer.
Adding, removing, or changing property in that object has no direct reflection on any other layers.

Returns: {object}

getTargetParent(dropToLastRow, physicalDropIndex){object|null}

Get the target row parent.

Parameters:
Name Type Description
dropToLastRow boolean

true if the row is moved to the last row of the table.

physicalDropIndex number

Physical drop row index.

Returns: {object|null} The target row parent.

getTranslatedPhrase(languageCode, dictionaryKey, argumentsForFormatters){string}

Get phrase for specified dictionary key.

Parameters:
Name Type Description
languageCode string

Language code for specific language i.e. 'en-US', 'pt-BR', 'de-DE'.

dictionaryKey string

Constant which is dictionary key.

argumentsForFormatters *

Arguments which will be handled by formatters.

Returns: {string}

getTrimmingContainer(base){HTMLElement}

Returns a DOM element responsible for trimming the provided element.

Parameters:
Name Type Description
base HTMLElement

Base element.

Returns: {HTMLElement} Base element's trimming parent.

getUnionOfArrays(arrays){Array}

Union of two or more arrays.

Parameters:
Name Type Description
arrays Array repeatable

Array of strings or array of numbers.

Returns: {Array} Returns the elements that exist in any of the arrays, without duplicates.

getValidLanguageCode(languageCode){string}

Returns valid language code. If the passed language code doesn't exist default one will be used.

Parameters:
Name Type Description
languageCode string

Language code for specific language i.e. 'en-US', 'pt-BR', 'de-DE'.

Returns: {string}

getValidSelection(hot){Array.<Array>|null}

Parameters:
Name Type Description
hot Core

The Handsontable instance.

Returns: {Array.<Array>|null}

getWindowScrollLeft(rootWindow){number}

Returns the document's scrollLeft property.

Parameters:
Name Type Description
rootWindow Window optional

The document window owner.

Returns: {number}

getWindowScrollTop(rootWindow){number}

Returns the document's scrollTop property.

Parameters:
Name Type Description
rootWindow Window optional

The document window owner.

Returns: {number}

handleMouseEvent(event, options)

Mouse handler for selection functionality.

Parameters:
Name Type Description
event Event

An native event to handle.

options object

The handler options.

Name Type Description
coords CellRange

The CellCoords object with defined visual coordinates.

selection Selection

The Selection class instance.

controller object

An object with keys row, column, cell which indicate what
operation will be performed in later selection stages.

Handsontable(rootElement, userSettings){Core}

Parameters:
Name Type Description
rootElement HTMLElement

The element to which the Handsontable instance is injected.

userSettings object

The user defined options.

Returns: {Core}

hasAccessToParentWindow(frame){boolean}

Checks if script has access to read from parent frame of specified frame.

Parameters:
Name Type Description
frame Window

Frame from which should be get frameElement in safe way.

Returns: {boolean}

hasCaptionProblem(){boolean}

Returns: {boolean}

hasClass(element, className){boolean}

Checks if element has class name.

Parameters:
Name Type Description
element HTMLElement

An element to check.

className string

Class name to check.

Returns: {boolean}

hasHorizontalScrollbar(element){boolean}

Checks if the provided element has a vertical scrollbar.

Parameters:
Name Type Description
element HTMLElement

An element to check.

Returns: {boolean}

hasLanguage(languageCode){boolean}

Get if language with specified language code was registered.

Parameters:
Name Type Description
languageCode string

Language code for specific language i.e. 'en-US', 'pt-BR', 'de-DE'.

Returns: {boolean}

hasOwnProperty(object, key){boolean}

Check if at specified key there is any value for object.

Parameters:
Name Type Description
object object

Object to search value at specyfic key.

key string

String key to check.

Returns: {boolean}

hasSubMenu(cell){boolean}

Parameters:
Name Type Description
cell HTMLElement

The HTML cell element to check.

Returns: {boolean}

hasValidParameter(rootSymbol){boolean}

Check if the source of the root indication call is valid.

Parameters:
Name Type Description
rootSymbol symbol

A symbol as a source of truth.

Returns: {boolean}

hasVerticalScrollbar(element){boolean}

Checks if the provided element has a vertical scrollbar.

Parameters:
Name Type Description
element HTMLElement

An element to check.

Returns: {boolean}

htmlToGridSettings(element, rootDocument){object}

Converts HTMLTable or string into Handsontable configuration object.

Parameters:
Name Type Description
element Element | string

Node element which should contain <table>...</table>.

rootDocument Document optional

The document window owner.

Returns: {object} Return configuration object. Contains keys as DefaultSettings.

index(element){number}

Counts index of element within its parent.
WARNING: for performance reasons, assumes there are only element nodes (no text nodes). This is true
for Walkotnable, otherwise would need to check for nodeType or use previousElementSibling.

Parameters:
Name Type Description
element Element

The element to check.

See:
Returns: {number}

info(args)

Logs info to the console if the console object is exposed.

Parameters:
Name Type Description
args * repeatable

Values which will be logged.

inherit(Child, Parent){object}

Inherit without without calling parent constructor, and setting Child.prototype.constructor to Child instead of Parent.
Creates temporary dummy function to call it as constructor.
Described in ticket: https://github.com/handsontable/handsontable/pull/516.

Parameters:
Name Type Description
Child object

The child class.

Parent object

The parent class.

Returns: {object}

init()

innerHeight(element){number}

Returns the element's inner height.

Parameters:
Name Type Description
element HTMLElement

An element to get the height from.

Returns: {number} Element's inner height.

innerWidth(element){number}

Returns the element's inner width.

Parameters:
Name Type Description
element HTMLElement

An element to get the width from.

Returns: {number} Element's inner width.

insert(key, amount)

Inserts an empty data to the map. This method creates an empty space for obtaining
new data.

Parameters:
Name Type Default Description
key number

The key as volatile zero-based index at which to begin inserting space for new data.

amount number 1 optional

Ammount of data to insert.

instanceToHTML(instance){string}

Converts Handsontable into HTMLTableElement.

Parameters:
Name Type Description
instance Core

The Handsontable instance.

Returns: {string} OuterHTML of the HTMLTableElement.

intersectValues(base, selected, defaultEmptyValue, callback){Array}

Intersect 'base' values with 'selected' values and return an array of object.

Parameters:
Name Type Description
base Array

An array of base values.

selected Array

An array of selected values.

defaultEmptyValue string

Default value for empty cells.

callback function optional

A callback function which is invoked for every item in an array.

Returns: {Array}

isChildOf(child, parent){boolean}

Goes up the DOM tree and checks if element is child of another element.

Parameters:
Name Type Description
child HTMLElement

Child element An element to check.

parent object | string

Parent element OR selector of the parent element.
If string provided, function returns true for the first occurrence of element with that class.

Returns: {boolean}

isChrome(){boolean}

Returns: {boolean}

isClassListSupported(){boolean}

Returns: {boolean}

isCtrlKey(keyCode){boolean}

Checks if passed key code is ctrl or cmd key. Depends on what OS the code runs it check key code based on
different meta key codes.

Parameters:
Name Type Description
keyCode number

The keyboard key code.

Returns: {boolean}

isCtrlMetaKey(keyCode){boolean}

Checks if passed key code is ctrl or cmd key. This helper checks if the key code matches to meta keys
regardless of the OS on which it is running.

Parameters:
Name Type Description
keyCode number

The keyboard key code.

Returns: {boolean}

isDefined(variable){boolean}

Checks if given variable is defined.

Parameters:
Name Type Description
variable *

Variable to check.

Returns: {boolean}

isDisabled(cell){boolean}

Parameters:
Name Type Description
cell HTMLElement

The HTML cell element to check.

Returns: {boolean}

isEdge(){boolean}

Returns: {boolean}

isEmpty(variable){boolean}

Check if given variable is null, empty string or undefined.

Parameters:
Name Type Description
variable *

Variable to check.

Returns: {boolean}

isFirefox(){boolean}

Returns: {boolean}

isFirstLevelColumnHeader(column, TH){boolean}

Get if handled header is first level column header.

Parameters:
Name Type Description
column number

Visual column index.

TH Element

Th HTML element.

Returns: {boolean}

isFormulaExpression(expression){boolean}

Check if provided expression is valid formula expression.

Parameters:
Name Type Description
expression *

Expression to check.

Returns: {boolean}

isFormulaExpressionEscaped(expression){boolean}

Check if provided formula expression is escaped.

Parameters:
Name Type Description
expression *

Expression to check.

Returns: {boolean}

isFunction(func){boolean}

Checks if given variable is function.

Parameters:
Name Type Description
func *

Variable to check.

Returns: {boolean}

isGetComputedStyleSupported(){boolean}

Returns: {boolean}

isHTMLTable(element){boolean}

Verifies if node is an HTMLTable element.

Parameters:
Name Type Description
element Node

Node to verify if it's an HTMLTable.

Returns: {boolean}

isIE(){boolean}

Returns: {boolean}

isIE9(){boolean}

Returns: {boolean}

isImmediatePropagationStopped(event){boolean}

Check if event was stopped by stopImmediatePropagation.

Parameters:
Name Type Description
event Event

The mouse event object.

Returns: {boolean}

isInput(element){boolean}

Determines if the given DOM element is an input field.
Notice: By 'input' we mean input, textarea and select nodes.

Parameters:
Name Type Description
element HTMLElement

DOM element.

Returns: {boolean}

isItemHidden(item, instance){boolean}

Parameters:
Name Type Description
item object

The object which describes the context menu item properties.

instance Core

The Handsontable instance.

Returns: {boolean}

isKey(keyCode, baseCode){boolean}

Parameters:
Name Type Description
keyCode number

The keyboard key code.

baseCode string

The list of the key codes to compare with.

Returns: {boolean}

isLeftClick(event){boolean}

Check if provided event was triggered by clicking the left mouse button.

Parameters:
Name Type Description
event Event

The mouse event object.

Returns: {boolean}

isLinuxOS(){boolean}

Returns: {boolean}

isMacOS(){boolean}

Returns: {boolean}

isMetaKey(keyCode){boolean}

Parameters:
Name Type Description
keyCode number

The keyboard key code.

Returns: {boolean}

isMobileBrowser(){boolean}

Returns: {boolean}

isMSBrowser(){boolean}

Returns: {boolean}

isNodeReflectsFirstChildColspan(node){boolean}

A tree helper which checks if passed node has the same original colspan as its
first child. In that case the node is treated as "mirrored" or "reflected" every
action performed on one of that nodes should be reflected to other "mirrored" node.

In that case nodes A1 and A2 are "refelcted"
+----+----+----+----+
| A1 | B1 |
+----+----+----+----+
| A2 | B2 | B3 |
+----+----+----+----+.

Parameters:
Name Type Description
node TreeNode

A tree node to check.

Returns: {boolean}

isNullish(variable){boolean}

Check if given variable is null or undefined.

Parameters:
Name Type Description
variable *

Variable to check.

Returns: {boolean}

isNumeric(value){boolean}

Checks if value of n is a numeric one
http://jsperf.com/isnan-vs-isnumeric/4.

Parameters:
Name Type Description
value *

The value to check.

Returns: {boolean}

isObject(object){boolean}

Determines whether given object is a plain Object.
Note: String and Array are not plain Objects.

Parameters:
Name Type Description
object *

An object to check.

Returns: {boolean}

isObjectEqual(object1, object2){boolean}

Checks if two objects or arrays are (deep) equal.

Parameters:
Name Type Description
object1 object | Array

The first object to compare.

object2 object | Array

The second object to compare.

Returns: {boolean}

isOutsideInput(element){boolean}

Determines if the given DOM element is an input field placed OUTSIDE of HOT.
Notice: By 'input' we mean input, textarea and select nodes which have defined 'data-hot-input' attribute.

Parameters:
Name Type Description
element HTMLElement

DOM element.

Returns: {boolean}

isPassiveEventSupported(){boolean}

Checks if browser supports passive events.

Returns: {boolean}

isPercentValue(value){boolean}

Checks if value is valid percent.

Parameters:
Name Type Description
value string

The value to check.

Returns: {boolean}

isPressed(keyCodes){boolean}

Checks if provided keyCode or keyCodes are pressed.

Parameters:
Name Type Description
keyCodes string

The key codes passed as a string defined in helpers/unicode.js file delimited with '|'.

Returns: {boolean}

isPressedCtrlKey(){boolean}

Checks if ctrl keys are pressed.

Returns: {boolean}

isPrintableChar(keyCode){boolean}

Returns true if keyCode represents a printable character.

Parameters:
Name Type Description
keyCode number

The keyboard key code.

Returns: {boolean}

isRegExp(variable){boolean}

Check if given variable is a regular expression.

Parameters:
Name Type Description
variable *

Variable to check.

Returns: {boolean}

isRightClick(event){boolean}

Check if provided event was triggered by clicking the right mouse button.

Parameters:
Name Type Description
event Event

The mouse event object.

Returns: {boolean}

isRootInstance(object){boolean}

Check if passed an object was flagged as a root instance.

Parameters:
Name Type Description
object object

An object to check.

Returns: {boolean}

isRowOrderChanged(movedRows, finalIndex){boolean}

Indicates if order of rows was changed.

Parameters:
Name Type Description
movedRows Array

Array of visual row indexes to be moved.

finalIndex number

Visual row index, being a start index for the moved rows. Points to where the elements
will be placed after the moving action. To check the visualization of the final index, please take a look at
documentation.

Returns: {boolean}

isSafari(){boolean}

Returns: {boolean}

isSelectionDisabled(cell){boolean}

Parameters:
Name Type Description
cell HTMLElement

The HTML cell element to check.

Returns: {boolean}

isSeparator(cell){boolean}

Parameters:
Name Type Description
cell HTMLElement

The HTML cell element to check.

Returns: {boolean}

isTextContentSupported(){boolean}

Returns: {boolean}

isTouchSupported(){boolean}

Returns: {boolean}

isUndefined(variable){boolean}

Checks if given variable is undefined.

Parameters:
Name Type Description
variable *

Variable to check.

Returns: {boolean}

isUnsignedNumber(value){boolean}

Helper which checks if the provided argument is an unsigned number.

Parameters:
Name Type Description
value *

Value to check.

Returns: {boolean}

isValidColumnState(columnState){boolean}

Get if column state is valid.

Parameters:
Name Type Description
columnState number

Particular column state.

Returns: {boolean}

isValidCoord(coord, maxTableItemsCount){boolean}

Check if passed value can be treated as valid cell coordinate. The second argument is
used to check if the value doesn't exceed the defined max table rows/columns count.

Parameters:
Name Type Description
coord number

The coordinate to validate (row index or column index).

maxTableItemsCount number

The value that declares the maximum coordinate that is still validatable.

Returns: {boolean}

isVisible(element){boolean}

Returns true if element is attached to the DOM and visible, false otherwise.

Parameters:
Name Type Description
element HTMLElement

An element to check.

Returns: {boolean}

isWindowsOS(){boolean}

Returns: {boolean}

itemsToValue(availableItems){Array}

Convert all checked items into flat array.

Parameters:
Name Type Description
availableItems Array

Base collection.

Returns: {Array}

log(args)

Logs message to the console if the console object is exposed.

Parameters:
Name Type Description
args * repeatable

Values which will be logged.

map(callback)

Maps the current state with a callback. For each source settings the callback function
is called. If the function returns value that value is merged with the source settings.

Parameters:
Name Type Description
callback function

A function that is called for every header settings.
Each time the callback is called, the returned value extends
header settings.

mapNodes(callback){Array}

Maps the current tree nodes with a callback. For each node the callback function
is called. If the function returns value that value is added to returned array.

Parameters:
Name Type Description
callback function

A function that is called for every tree node.
Each time the callback is called, the returned value is
added to returned array.

Returns: {Array}

mapState(callback)

Maps the current state with a callback. For each header settings the callback function
is called. If the function returns value that value is merged with the state.

By default only foreign keys are merged with source state and passed to the tree. But only
known keys are exported to matrix.

Parameters:
Name Type Description
callback function

A function that is called for every header source settings.
Each time the callback is called, the returned value extends
header settings.

markLabelAsSelected(label){string}

Parameters:
Name Type Description
label string

The label text.

Returns: {string}

markSelected(label){string}

Mark label in contextMenu as selected.

Parameters:
Name Type Description
label string

The label text.

Returns: {string}

matchesCSSRules(element, rule){boolean}

Verifies if element fit to provided CSSRule.

Parameters:
Name Type Description
element Element

Element to verify with selector text.

rule CSSRule

Selector text from CSSRule.

Returns: {boolean}

merge(array, compareFunction, startIndex, middleIndex, endIndex){Array}

Devides and sort merges two subarrays of given array.

Parameters:
Name Type Description
array Array

The array which subarrays should be sorted.

compareFunction function

The function with comparision logic.

startIndex number

The start of the first subarray.
This subarray is with end middle - 1.

middleIndex number

The start of the second array.

endIndex number

End - 1 is the end of the second array.

Returns: {Array} The array with sorted subarray.

mergeStateWith(settings)

Merges settings with current plugin state.

By default only foreign keys are merged with source state and passed to the tree. But only
known keys are exported to matrix.

Parameters:
Name Type Description
settings Array.<object>

An array of objects to merge with the current source settings.
It is a requirement that every object has row and col properties
which points to the specific header settings object.

mergeWith(additionalSettings)

Merges settings with current source settings.

Parameters:
Name Type Description
additionalSettings Array.<object>

An array of objects with row, col and additional
properties to merge with current source settings.

mixin(Base, mixins){object}

Extend the Base object (usually prototype) of the functionality the mixins objects.

Parameters:
Name Type Description
Base object

Base object which will be extended.

mixins object

The object of the functionality will be "copied".

Returns: {object}

mouseDown(options)

MouseDown handler.

Parameters:
Name Type Description
options object

The handler options.

Name Type Description
isShiftKey boolean

The flag which indicates if the shift key is pressed.

isLeftClick boolean

The flag which indicates if the left mouse button is pressed.

isRightClick boolean

The flag which indicates if the right mouse button is pressed.

coords CellRange

The CellCoords object with defined visual coordinates.

selection Selection

The Selection class instance.

controller object

An object with keys row, column, cell which indicate what
operation will be performed in later selection stages.

mouseOver(options)

MouseOver handler.

Parameters:
Name Type Description
options object

The handler options.

Name Type Description
isLeftClick boolean

Indicates that event was fired using the left mouse button.

coords CellRange

The CellCoords object with defined visual coordinates.

selection Selection

The Selection class instance.

controller object

An object with keys row, column, cell which indicate what
operation will be performed in later selection stages.

moveCellsMeta(baseIndexes, targetIndex)

Move the cell meta for multiple rows.

Parameters:
Name Type Description
baseIndexes Array.<number>

Array of indexes for the rows being moved.

targetIndex number

Index of the destination of the move.

moveRows(physicalStartIndexes, physicalDropIndex, targetParent)

Move the rows at the provided coordinates.

Parameters:
Name Type Description
physicalStartIndexes Array.<number>

Physical indexes of the rows about to be moved.

physicalDropIndex number

Physical drop index.

targetParent object

Parent of the destination row.

normalizeLanguageCode(languageCode){string}

Normalize language code. It takes handled languageCode proposition and change it to proper languageCode.
For example, when it takes eN-us as parameter it return en-US.

Parameters:
Name Type Description
languageCode string

Language code for specific language i.e. 'en-US', 'pt-BR', 'de-DE'.

Returns: {string}

normalizeSelection(selRanges){Array.<object>}

Parameters:
Name Type Description
selRanges Array.<CellRange>

An array of the cell ranges.

Returns: {Array.<object>}

normalizeSelectionFactory(type, options){Array.<number>}

Factory function designed for normalization data schema from different data structures of the selection ranges.

Parameters:
Name Type Description
type string

Selection type which will be processed.

options object optional

The normalization options.

Name Type Default Description
keepDirection boolean false optional

If true, the coordinates which contain the direction of the
selected cells won't be changed. Otherwise, the selection will be
normalized to values starting from top-left to bottom-right.

propToCol function optional

Pass the converting function (usually datamap.propToCol) if the column
defined as props should be normalized to the numeric values.

Returns: {Array.<number>} Returns normalized data about selected range as an array ([rowStart, columnStart, rowEnd, columnEnd]).

normalizeSettings(sourceSettings, columnsLimit){Array.<Array>}

A function that normalizes user-defined settings into one predictable
structure. Currently, the developer can declare nested headers by passing
the following unstructured (and sometimes uncompleted) array.
[
[{ label: 'A1', colspan: 2 }],
[{ label: true }, 'B2', 4],
[],
]

The normalization process equalizes the length of columns to each header
layers to the same length and generates object settings with a common shape.
So the above mentioned example will be normalized into this:
[
[
{ label: 'A1', colspan: 2, isHidden: false, ... },
{ label: '', colspan: 1, isHidden: true, ... },
{ label: '', colspan: 1, isHidden: false, ... },
],
[
{ label: 'true', colspan: 1, isHidden: false, ... },
{ label: 'B2', colspan: 1, isHidden: false, ... },
{ label: '4', colspan: 1, isHidden: false, ... },
],
[
{ label: '', colspan: 1, isHidden: false, ... },
{ label: '', colspan: 1, isHidden: false, ... },
{ label: '', colspan: 1, isHidden: false, ... },
],
]

Parameters:
Name Type Default Description
sourceSettings Array.<Array>

An array with defined nested headers settings.

columnsLimit number Infinity optional

A number of columns to which the structure
will be trimmed. While trimming the colspan
values are adjusted to preserve the original
structure.

Returns: {Array.<Array>}

objectEach(object, iteratee){object}

A specialized version of .forEach for objects.

Parameters:
Name Type Description
object object

The object to iterate over.

iteratee function

The function invoked per iteration.

Returns: {object} Returns object.

obtain(key){*}

Gets or if data not exist creates and returns new data.

Parameters:
Name Type Description
key number

The item key as zero-based index.

Returns: {*}

offset(element){object}

Returns elements top and left offset relative to the document. Function is not compatible with jQuery offset.

Parameters:
Name Type Description
element HTMLElement

An element to get the offset position from.

Returns: {object} Returns object with top and left props.

onAfterChange(changes, source){boolean}

Parameters:
Name Type Description
changes Array

2D array containing information about each of the edited cells.

source string

String that identifies source of hook call.

Returns: {boolean}

onBeforeKeyDown(event)

Parameters:
Name Type Description
event Event

The keyboard event object.

onBeforeRowMove(rows, finalIndex, dropIndex, movePossible){boolean}

beforeRowMove hook callback.

Parameters:
Name Type Description
rows Array

Array of visual row indexes to be moved.

finalIndex number

Visual row index, being a start index for the moved rows. Points to where the elements
will be placed after the moving action. To check the visualization of the final index, please take a look at
documentation.

dropIndex undefined | number

Visual row index, being a drop index for the moved rows. Points to where we
are going to drop the moved elements. To check visualization of drop index please take a look at
documentation.

movePossible boolean

Indicates if it's possible to move rows to the desired position.

Fires:
Returns: {boolean}

onChange(event, instance){boolean}

change callback.

Parameters:
Name Type Description
event Event

change event.

instance Core

The Handsontable instance.

Returns: {boolean}

operate()

Translate all CellValues depends on previous position.

operate(start, amount, modifyFormula)

Execute changes.

Parameters:
Name Type Default Description
start number

Index column from which the operation starts.

amount number

Count of columns to be inserted.

modifyFormula boolean true optional

If true all formula expressions will be modified according to the changes.
false value is used by UndoRedo plugin which saves snapshoots before alter
operation so it doesn't have to modify formulas if "undo" action was triggered.

operate(start, amount, modifyFormula)

Execute changes.

Parameters:
Name Type Default Description
start number

Index row from which the operation starts.

amount number

Count of rows to be removed.

modifyFormula boolean true optional

If true all formula expressions will be modified according to the changes.
false value is used by UndoRedo plugin which saves snapshoots before alter
operation so it doesn't modify formulas if undo action is triggered.

operate(start, amount, modifyFormula)

Execute changes.

Parameters:
Name Type Default Description
start number

Index row from which the operation starts.

amount number

Count of rows to be inserted.

modifyFormula boolean true optional

If true all formula expressions will be modified according to the changes.
false value is used by UndoRedo plugin which saves snapshoots before alter
operation so it doesn't modify formulas if undo action is triggered.

operate(start, amount, modifyFormula)

Execute changes.

Parameters:
Name Type Default Description
start number

Index column from which the operation starts.

amount number

Count of columns to be removed.

modifyFormula boolean true optional

If true all formula expressions will be modified according to the changes.
false value is used by UndoRedo plugin which saves snapshoots before alter
operation so it doesn't modify formulas if undo action is triggered.

operationResult(conditions, value){boolean}

Parameters:
Name Type Description
conditions Array

An array with values to check.

value *

The comparable value.

Returns: {boolean}

operationResult(conditions, value){boolean}

Parameters:
Name Type Description
conditions Array

An array with values to check.

value *

The comparable value.

Returns: {boolean}

operationResult(conditions, value){boolean}

Parameters:
Name Type Description
conditions Array

An array with values to check.

value *

The comparable value.

Returns: {boolean}

outerHeight(element){number}

Returns the element's outer height.

Parameters:
Name Type Description
element HTMLElement

An element to get the height from.

Returns: {number} Element's outer height.

outerWidth(element){number}

Returns the element's outer width.

Parameters:
Name Type Description
element HTMLElement

An element to get the width from.

Returns: {number} Element's outer width.

overlayContainsElement(overlayType, element, root){boolean}

Check if the provided overlay contains the provided element.

Parameters:
Name Type Description
overlayType string

The type of the overlay.

element HTMLElement

An element to check.

root HTMLElement

The root element.

Returns: {boolean}

parseDelay(delay){number}

Convert delay from string format to milliseconds.

Parameters:
Name Type Description
delay number | string

The delay in FPS (frame per second) or number format.

Returns: {number}

parsePath(path){object|null}

Extract coordinates from path where data was changed.

Parameters:
Name Type Description
path string

Path describing where data was changed.

Returns: {object|null} Returns an object with row and col properties or null if path doesn't have necessary information.

partial(func, params){function}

Creates the function that returns the function with cached arguments.

Parameters:
Name Type Description
func function

Function to partialization.

params Array

Function arguments to cache.

Returns: {function}

pipe(functions){function}

Creates the function that returns the result of calling the given functions. Result of the first function is passed to
the second as an argument and so on. Only first function in the chain can handle multiple arguments.

Parameters:
Name Type Description
functions function

Functions to compose.

Returns: {function}

pivot(arr){Array}

Parameters:
Name Type Description
arr Array

An array to pivot.

Returns: {Array}

popSeparators(items, separator){Array.<object>}

Parameters:
Name Type Description
items Array.<object>

The context menu items collection.

separator string

The string which identifies the context menu separator item.

Returns: {Array.<object>}

predefinedItems(){object}

Gets new object with all predefined menu items.

Returns: {object}

prepare()

Collect all previous visual rows from CellValues.

prepareHorizontalAlignClass(className, alignment){string}

Parameters:
Name Type Description
className string

The full element class name to process.

alignment string

The slignment class name to compare with.

Returns: {string}

prepareVerticalAlignClass(className, alignment){string}

Parameters:
Name Type Description
className string

The full element class name to process.

alignment string

The slignment class name to compare with.

Returns: {string}

process(value, callback){function}

Function responsible for validation of autocomplete value.

Parameters:
Name Type Description
value *

Value of edited cell.

callback function

Callback called with validation result.

Returns: {function}

randomString(){string}

Generates a random hex string. Used as namespace for Handsontable instance events.

Returns: {string} Returns 16-long character random string (eq. '92b1bfc74ec4').

rangeEach(rangeFrom, rangeTo, iteratee)

A specialized version of .forEach defined by ranges.

Parameters:
Name Type Description
rangeFrom Number

The number from start iterate.

rangeTo Number | function