Class: Highlight

Highlight

Highlight class responsible for managing Walkontable Selection classes.

With Highlight object you can manipulate four different highlight types:

  • cell can be added only to a single cell at a time and it defines currently selected cell;
  • fill can occur only once and its highlight defines selection of autofill functionality (managed by the plugin with the same name);
  • areas can be added to multiple cells at a time. This type highlights selected cell or multiple cells.
    The multiple cells have to be defined as an uninterrupted order (regular shape). Otherwise, the new layer of
    that type should be created to manage not-consecutive selection;
  • header can occur multiple times. This type is designed to highlight only headers. Like area type it
    can appear with multiple highlights (accessed under different level layers).

Members

activeHeadersMap.<number, Selection>

Collection of the active-header highlights. That objects describes attributes for the selection of
the multiple selected rows and columns in the table header. The table headers which have selected all items in
a row will be marked as active-header.

areasMap.<number, Selection>

Collection of the area highlights. That objects describes attributes for the borders and selection of
the multiple selected cells. It can occur multiple times on the table.

cellSelection

cell highlight object which describes attributes for the currently selected cell.
It can only occur only once on the table.

customSelectionsArray.<Selection>

Collection of the custom-selection, holder for example borders added through CustomBorders plugin.

fillSelection

fill highlight object which describes attributes for the borders for autofill functionality.
It can only occur only once on the table.

headersMap.<number, Selection>

Collection of the header highlights. That objects describes attributes for the selection of
the multiple selected rows and columns in the table header. It can occur multiple times on the table.

layerLevelNumber

The property which describes which layer level of the visual selection will be modified.
This option is valid only for area and header highlight types which occurs multiple times on
the table (as a non-consecutive selection).

An order of the layers is the same as the order of added new non-consecutive selections.

Default Value: 0

optionsObject

Options consumed by Highlight class and Walkontable Selection classes.

Methods

addCustomSelection(options)

Add selection to the custom selection instance. The new selection are added to the end of the selection collection.

Parameters:
Name Type Description
options Object

clear()

Perform cleaning visual highlights for the whole table.

createOrGetActiveHeader(){Selection}

Get or create (if not exist in the cache) Walkontable Selection instance created for controlling highlight
of the multiple selected active header cells.

Returns: {Selection}

createOrGetArea(){Selection}

Get or create (if not exist in the cache) Walkontable Selection instance created for controlling highlight
of the multiple selected cells.

Returns: {Selection}

createOrGetHeader(){Selection}

Get or create (if not exist in the cache) Walkontable Selection instance created for controlling highlight
of the multiple selected header cells.

Returns: {Selection}

getActiveHeaders(){Array.<Selection>}

Get all Walkontable Selection instances which describes the state of the visual highlight of the active headers.

Returns: {Array.<Selection>}

getAreas(){Array.<Selection>}

Get all Walkontable Selection instances which describes the state of the visual highlight of the cells.

Returns: {Array.<Selection>}

getCell(){Selection}

Get Walkontable Selection instance created for controlling highlight of the currently selected/edited cell.

Returns: {Selection}

getCustomSelections(){Selection}

Get Walkontable Selection instance created for controlling highlight of the custom selection functionality.

Returns: {Selection}

getFill(){Selection}

Get Walkontable Selection instance created for controlling highlight of the autofill functionality.

Returns: {Selection}

getHeaders(){Array.<Selection>}

Get all Walkontable Selection instances which describes the state of the visual highlight of the headers.

Returns: {Array.<Selection>}

isEnabledFor(highlightType){Boolean}

Check if highlight cell rendering is disabled for specyfied highlight type.

Parameters:
Name Type Description
highlightType String

Highlight type. Possible values are: cell, area, fill or header.

Returns: {Boolean}

useLayerLevel(level){Highlight}

Set a new layer level to make access to the desire area and header highlights.

Parameters:
Name Type Default Description
level Number 0 optional

Layer level to use.

Returns: {Highlight}