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
mergedCellCoords.removed : boolean
true only if the merged cell is bound to be removed.
Methods
containsNegativeValues
MergedCellCoords.containsNegativeValues(mergedCell) ⇒ boolean
Check whether the values provided for a merged cell contain any negative values.
| Param | Type | Description |
|---|---|---|
| mergedCell | Object | Object containing information about the merged cells that was about to be added. |
getLastColumn
mergedCellCoords.getLastColumn() ⇒ number
Get the rightmost column index of the merged cell.
getLastRow
mergedCellCoords.getLastRow() ⇒ number
Get the bottom row index of the merged cell.
getRange
mergedCellCoords.getRange() ⇒ CellRange
Get the range coordinates of the merged cell.
includes
mergedCellCoords.includes(row, column) ⇒ boolean
Returns true if the provided coordinates are inside the merged cell.
| Param | Type | Description |
|---|---|---|
| row | number | The row index. |
| column | number | The column index. |
includesHorizontally
mergedCellCoords.includesHorizontally(column) ⇒ boolean
Returns true if the provided column property is within the column span of the merged cell.
| Param | Type | Description |
|---|---|---|
| column | number | The column index. |
includesVertically
mergedCellCoords.includesVertically(row) ⇒ boolean
Returns true if the provided row property is within the row span of the merged cell.
| Param | Type | Description |
|---|---|---|
| row | number | Row index. |
IS_OUT_OF_BOUNDS_WARNING
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.
| Param | Type | Description |
|---|---|---|
| mergedCell | Object | Object containing information about the merged cells that was about to be added. |
IS_SINGLE_CELL
MergedCellCoords.IS_SINGLE_CELL(mergedCell) ⇒ string
Get a warning message for when the declared merged cell data represents a single cell.
| Param | Type | Description |
|---|---|---|
| mergedCell | Object | Object containing information about the merged cells that was about to be added. |
isFarther
mergedCellCoords.isFarther(mergedCell, direction) ⇒ boolean | null
Check if the second provided merged cell is “farther” in the provided direction.
| Param | Type | Description |
|---|---|---|
| mergedCell | MergedCellCoords | The merged cell to check. |
| direction | string | Drag direction. |
Returns: boolean | null - true if the second provided merged cell is “farther”.
isOutOfBounds
MergedCellCoords.isOutOfBounds(mergeCell, rowCount, columnCount) ⇒ boolean
Check whether the provided merged cell object is to be declared out of bounds of the table.
| Param | Type | Description |
|---|---|---|
| mergeCell | object | Object containing the row, col, rowspan and colspan properties. |
| rowCount | number | Number of rows in the table. |
| columnCount | number | Number of rows in the table. |
NEGATIVE_VALUES_WARNING
MergedCellCoords.NEGATIVE_VALUES_WARNING(mergedCell) ⇒ string
Get a warning message for when the declared merged cell data contains negative values.
| Param | Type | Description |
|---|---|---|
| mergedCell | Object | Object containing information about the merged cells that was about to be added. |
normalize
mergedCellCoords.normalize(hotInstance)
Sanitize (prevent from going outside the boundaries) the merged cell.
| Param | Type | Description |
|---|---|---|
| hotInstance | Core | The Handsontable instance. |
relocate
mergedCellCoords.relocate(row, col, [rowspan])
Sets a new visual top-left (and optionally a new row span) and invalidates the lazily cached
range, so callers that mutate the merge’s position (e.g. re-anchoring to visible rows) don’t leave
getRange() serving stale coords. The span is passed when rows inside the merge have been trimmed
away, which shrinks the visual space the merge occupies.
| Param | Type | Description |
|---|---|---|
| row | number | New top row index. |
| col | number | New left column index. |
| [rowspan] | number | optional New row span. Defaults to the current one. |
shift
mergedCellCoords.shift(shiftVector, indexOfChange) ⇒ boolean
Shift (and possibly resize, if needed) the merged cell.
| Param | Type | Description |
|---|---|---|
| shiftVector | Array | 2-element array containing the information on the shifting in the x and y axis. |
| indexOfChange | number | Index of the preceding change. |
Returns: boolean - Returns false if the whole merged cell was removed.
ZERO_SPAN_WARNING
MergedCellCoords.ZERO_SPAN_WARNING(mergedCell) ⇒ string
Get a warning message for when the declared merged cell data contains “colspan” or “rowspan”, that equals 0.
| Param | Type | Description |
|---|---|---|
| mergedCell | Object | Object containing information about the merged cells that was about to be added. |