TableColumns

TableColumns

Created by IvanP on 09.09.2016.

Constructor

new TableColumns(options)

Source:

Creates an array of objects corresponding to the cells of defaultHeaderRow, that contain sortable property, denoting the column is sortable, index of the column and reference to the cell. Adds .sortable to a sortable cell

Parameters:
Name Type Description
options Object

options passed to configure the Sorting

Properties
Name Type Attributes Default Description
source HTMLTableElement

source table sorting will be applied to

refSource HTMLTableElement

floating header if any

defaultHeaderRow Number | Object <optional>
-1

index of the row in thead (incremented from 0) that will have sorting enabled for columns. If -1 then last row.

Methods

(static) computeColumns(theadnon-null, refTheadnon-null, defaultHeaderRowIndex) → (nullable) {Array}

Source:

Gets an array of columns from the table

Parameters:
Name Type Description
thead HTMLTableElement

source table header

refThead HTMLTableElement

reference table header from floating header if any

defaultHeaderRowIndex Number

index of the row in thead (incremented from 0) that will be considered default to have actions executed upon.

Returns:

Returns an array of header cell nodes or null if thead is not specified

Type
Array

(static) getDefaultHeaderRow(theadnon-null, defaultHeaderRowIndexnon-null) → {Object}

Source:

Calculates defaultHeaderRow for a passed thead

Parameters:
Name Type Description
thead HTMLTableElement

source table header

defaultHeaderRowIndex Number

index of the row in thead (incremented from 0) that will be considered default to have actions executed upon.

Returns:
Type
Object

(static) getHeader(source)

Source:

Gets a header

Parameters:
Name Type Description
source HTMLTableElement

source table headers are created for

(static) getHeaderCells(theadnullable, defaultHeaderRowIndexnon-null) → (nullable) {Array}

Source:

Gets an array of header cell nodes from default header row

Parameters:
Name Type Attributes Description
thead HTMLTableElement <nullable>

source table header

defaultHeaderRowIndex Number

index of the row in thead (incremented from 0) that will be considered default to have actions executed upon.

Returns:

Returns an array of header cell nodes or null if thead is not specified

Type
Array