Skip to content

MergedCellCoords

Description

The MergedCellCoords class represents a single merged cell.

Description

Initializes the merged cell coordinates with its top-left position, span dimensions, and factories for creating cell coordinate and range objects.

Members

removed

Source code

mergedCellCoords.removed : boolean

true only if the merged cell is bound to be removed.

Methods

containsNegativeValues

Source code

MergedCellCoords.containsNegativeValues(mergedCell) ⇒ boolean

Check whether the values provided for a merged cell contain any negative values.

ParamTypeDescription
mergedCellObjectObject containing information about the merged cells that was about to be added.

getLastColumn

Source code

mergedCellCoords.getLastColumn() ⇒ number

Get the rightmost column index of the merged cell.

getLastRow

Source code

mergedCellCoords.getLastRow() ⇒ number

Get the bottom row index of the merged cell.

getRange

Source code

mergedCellCoords.getRange() ⇒ CellRange

Get the range coordinates of the merged cell.

includes

Source code

mergedCellCoords.includes(row, column) ⇒ boolean

Returns true if the provided coordinates are inside the merged cell.

ParamTypeDescription
rownumberThe row index.
columnnumberThe column index.

includesHorizontally

Source code

mergedCellCoords.includesHorizontally(column) ⇒ boolean

Returns true if the provided column property is within the column span of the merged cell.

ParamTypeDescription
columnnumberThe column index.

includesVertically

Source code

mergedCellCoords.includesVertically(row) ⇒ boolean

Returns true if the provided row property is within the row span of the merged cell.

ParamTypeDescription
rownumberRow index.

IS_OUT_OF_BOUNDS_WARNING

Source code

MergedCellCoords.IS_OUT_OF_BOUNDS_WARNING(mergedCell) ⇒ string

Get a warning message for when the declared merged cell data contains values exceeding the table limits.

ParamTypeDescription
mergedCellObjectObject containing information about the merged cells that was about to be added.

IS_SINGLE_CELL

Source code

MergedCellCoords.IS_SINGLE_CELL(mergedCell) ⇒ string

Get a warning message for when the declared merged cell data represents a single cell.

ParamTypeDescription
mergedCellObjectObject containing information about the merged cells that was about to be added.

isFarther

Source code

mergedCellCoords.isFarther(mergedCell, direction) ⇒ boolean | null

Check if the second provided merged cell is “farther” in the provided direction.

ParamTypeDescription
mergedCellMergedCellCoordsThe merged cell to check.
directionstringDrag direction.

Returns: boolean | null - true if the second provided merged cell is “farther”.

isOutOfBounds

Source code

MergedCellCoords.isOutOfBounds(mergeCell, rowCount, columnCount) ⇒ boolean

Check whether the provided merged cell object is to be declared out of bounds of the table.

ParamTypeDescription
mergeCellobjectObject containing the row, col, rowspan and colspan properties.
rowCountnumberNumber of rows in the table.
columnCountnumberNumber of rows in the table.

NEGATIVE_VALUES_WARNING

Source code

MergedCellCoords.NEGATIVE_VALUES_WARNING(mergedCell) ⇒ string

Get a warning message for when the declared merged cell data contains negative values.

ParamTypeDescription
mergedCellObjectObject containing information about the merged cells that was about to be added.

normalize

Source code

mergedCellCoords.normalize(hotInstance)

Sanitize (prevent from going outside the boundaries) the merged cell.

ParamTypeDescription
hotInstanceCoreThe Handsontable instance.

shift

Source code

mergedCellCoords.shift(shiftVector, indexOfChange) ⇒ boolean

Shift (and possibly resize, if needed) the merged cell.

ParamTypeDescription
shiftVectorArray2-element array containing the information on the shifting in the x and y axis.
indexOfChangenumberIndex of the preceding change.

Returns: boolean - Returns false if the whole merged cell was removed.

ZERO_SPAN_WARNING

Source code

MergedCellCoords.ZERO_SPAN_WARNING(mergedCell) ⇒ string

Get a warning message for when the declared merged cell data contains “colspan” or “rowspan”, that equals 0.

ParamTypeDescription
mergedCellObjectObject containing information about the merged cells that was about to be added.