Class: CollapsingUI

CollapsingUI

Class responsible for the UI for collapsing and expanding groups.

Extends

Members

buildStateBoolean

Flag which determines build state of element.

element

Get element as a DOM object.

eventManagerEventManager

Instance of EventManager.

hotCore

Instance of Handsontable.

optionsObject

List of element options.

plugin

Reference to the main plugin instance.

stateBoolean

Flag which determines build state of element.

trimRowsPlugin

Reference to the Trim Rows plugin.

Methods

inherited appendTo(wrapper)

Add created UI elements to table.

Parameters:
Name Type Description
wrapper HTMLElement

Element which are parent for our UI element.

inherited build()

Method for create UI element. Only create, without append to table.

collapseAll()

Collapse all collapsable rows.

collapseChildren(row, forceRender)

Collapse the children of the row passed as an argument.

Parameters:
Name Type Default Description
row Number | Object

The parent row.

forceRender Boolean true optional

Whether to render the table after the function ends.

collapseChildRows(parentIndex, rowsToTrim, recursive, doTrimming)

Collapse child rows of the row at the provided index.

Parameters:
Name Type Default Description
parentIndex Number

Index of the parent node.

rowsToTrim Array [] optional

Array of rows to trim. Defaults to an empty array.

recursive Boolean optional

true if the collapsing process should be recursive.

doTrimming Boolean false optional

true if rows should be trimmed.

collapseMultipleChildren(rows, forceRender, doTrimming)

Collapse multiple children.

Parameters:
Name Type Default Description
rows Array

Rows to collapse (including their children)

forceRender Boolean true optional

true if the table should be rendered after finishing the function.

doTrimming Boolean true optional

true if the table should trim the provided rows.

collapseRow(rowIndex, recursive)

Collapse a single row.

Parameters:
Name Type Default Description
rowIndex Number

Index of the row to collapse.

recursive Boolean true optional

true if it should collapse the row's children.

collapseRows(rowIndexes, recursive, doTrimming){Array}

Collapse multiple rows.

Parameters:
Name Type Default Description
rowIndexes Array

Array of row indexes to collapse.

recursive Boolean true optional

true if it should collapse the rows' children.

doTrimming Boolean false optional

true if the provided rows should be collapsed.

Returns: {Array} Rows prepared for trimming (or trimmed, if doTrimming == true)

inherited destroy()

Method for remove UI element.

expandAll()

Expand all collapsable rows.

expandChildren(row, forceRender, doTrimming)

Expand the children of the row passed as an argument.

Parameters:
Name Type Default Description
row Number | Object

Parent row.

forceRender Boolean true optional

Whether to render the table after the function ends.

doTrimming Boolean true optional

If set to true, the trimming will be applied when the function finishes.

expandChildRows(parentIndex, rowsToUntrim, recursive, doTrimming)

Expand child rows of the provided index.

Parameters:
Name Type Default Description
parentIndex Number

Index of the parent row.

rowsToUntrim Array [] optional

Array of the rows to be untrimmed.

recursive Boolean optional

true if it should expand the rows' children recursively.

doTrimming Boolean false optional

true if rows should be untrimmed.

expandMultipleChildren(rows, forceRender, doTrimming)

Expand multiple rows' children.

Parameters:
Name Type Default Description
rows Array

Array of rows which children are about to be expanded.

forceRender Boolean true optional

true if the table should render after finishing the function.

doTrimming Boolean true optional

true if the rows should be untrimmed after finishing the function.

expandRow(rowIndex, recursive)

Expand a single row.

Parameters:
Name Type Default Description
rowIndex Number

Index of the row to expand.

recursive Boolean true optional

true if it should expand the row's children recursively.

expandRows(rowIndexes, recursive, doTrimming){Array}

Expand multiple rows.

Parameters:
Name Type Default Description
rowIndexes Array

Array of indexes of the rows to expand.

recursive Boolean true optional

true if it should expand the rows' children recursively.

doTrimming Boolean false optional

true if rows should be untrimmed.

Returns: {Array} Array of row indexes to be untrimmed.

inherited focus()

Focus element.

inherited getOffset(){Object}

Getter for the element offset.

Returns: {Object} Object contains top and left offset of the element.

inherited getPosition(){Object}

Getter for the element position.

Returns: {Object} Object contains left and top position of the element.

inherited getSize(){Object}

Getter for the element position.

Returns: {Object} Object contains height and width of the element.

inherited getValue(){*}

Get the element value.

Returns: {*}

inherited hide()

Hide element.

inherited isAppended(){Boolean}

Check if UI element are appended.

Returns: {Boolean}

inherited isBuilt(){Boolean}

Check if UI element are built.

Returns: {Boolean}

inherited reset()

Reset to initial state.

inherited setOffset(top, left)

Setter for the element offset. Offset means marginTop and marginLeft of the element.

Parameters:
Name Type Description
top Number

New margin top of the element.

left Number

New margin left of the element.

inherited setPosition(top, left)

Setter for position.

Parameters:
Name Type Description
top Number

New top position of the element.

left Number

New left position of the element.

inherited setSize(width, height)

Setter for the element size.

Parameters:
Name Type Description
width Number

New width of the element.

height Number

New height of the element.

inherited setValue(){*}

Set the element value.

Returns: {*}

inherited show()

Show element.

inherited translateIfPossible(value){*}

Translate value if it is possible. It's checked if value belongs to namespace of translated phrases.

Parameters:
Name Type Description
value *

Value which will may be translated.

Returns: {*} Translated value if translation was possible, original value otherwise.

inherited update()

Update DOM structure.