Class: MergedCellCoords

MergedCellCoords

The MergedCellCoords class represents a single merged cell.

Members

colNumber

The index of the leftmost column.

colspanNumber

The colspan value of the merged cell.

removedBoolean

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

rowNumber

The index of the topmost merged cell row.

rowspanNumber

The rowspan value of the merged cell.

Methods

staticMergedCellCoords.containsNegativeValues(mergedCellInfo){Boolean}

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

Parameters:
Name Type Description
mergedCellInfo Object

Object containing the row, col, rowspan and colspan properties.

Returns: {Boolean}

staticMergedCellCoords.IS_OUT_OF_BOUNDS_WARNING(newMergedCell){String}

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

Parameters:
Name Type Description
newMergedCell Object

Object containg information about the merged cells that was about to be added.

Returns: {String}

staticMergedCellCoords.IS_SINGLE_CELL(newMergedCell){String}

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

Parameters:
Name Type Description
newMergedCell Object

Object containg information about the merged cells that was about to be added.

Returns: {String}

staticMergedCellCoords.isOutOfBounds(mergeCell, rowCount, columnCount){Boolean}

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

Parameters:
Name 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.

Returns: {Boolean}

staticMergedCellCoords.NEGATIVE_VALUES_WARNING(newMergedCell){String}

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

Parameters:
Name Type Description
newMergedCell Object

Object containg information about the merged cells that was about to be added.

Returns: {String}

staticMergedCellCoords.ZERO_SPAN_WARNING(newMergedCell){String}

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

Parameters:
Name Type Description
newMergedCell Object

Object containg information about the merged cells that was about to be added.

Returns: {String}

getLastColumn(){Number}

Get the rightmost column index of the merged cell.

Returns: {Number}

getLastRow(){Number}

Get the bottom row index of the merged cell.

Returns: {Number}

getRange(){CellRange}

Get the range coordinates of the merged cell.

Returns: {CellRange}

includes(row, column){Boolean}

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

Parameters:
Name Type Description
row Number

The row index.

column Number

The column index.

Returns: {Boolean}

includesHorizontally(column){Boolean}

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

Parameters:
Name Type Description
column Number

The column index.

Returns: {Boolean}

includesVertically(row){Boolean}

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

Parameters:
Name Type Description
row Number

Row index.

Returns: {Boolean}

isFarther(mergedCell, direction){Boolean|null}

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

Parameters:
Name 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".

normalize(hotInstance)

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

Parameters:
Name Type Description
hotInstance

shift(shiftVector, indexOfChange){Boolean}

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

Parameters:
Name 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.