new SortTable()
- Source:
Properties:
| Name | Type | Description |
|---|---|---|
source |
HTMLTableElement | source table |
data |
Array | data array to be sorted |
multidimensional |
Boolean | if |
sortOrder |
SortOrder | instance of |
columns |
TableColumns | instance of |
Methods
(static) defineSortableColumns(columns, includedopt, excludedopt)
- Source:
Checks the table columns array against the included/excluded columns arrays and adds a sortable:true property and a .sortable class to the sortable ones
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
columns |
TableColumns | an instance of |
|
included |
Array |
<optional> |
array of included columns indices |
excluded |
Array |
<optional> |
array of excluded columns indices |
(static) listenForSort(delegatedTarget, columns, sortOrder)
- Source:
sets up listeners for column headers available for click
Parameters:
| Name | Type | Description |
|---|---|---|
delegatedTarget |
HTMLElement | element that will receive clicks and see if they are valid, |
columns |
TableColumns | array of table columns from |
sortOrder |
SortOrder | instance of |
Listens to Events:
- event:click
(static) sortDimension(data, columns, sortOrder)
- Source:
Splits sorting into one-column or two-column. The precedence of columns in sortOrder is the factor defining sort priority
Parameters:
| Name | Type | Description |
|---|---|---|
data |
Array | array containing row items to be sorted |
columns |
TableColumns | array of table columns from |
sortOrder |
SortOrder | instance of |
(static) sorter()
- Source:
Function that performs case insensitive sorting in the array. It can distinguish between numbers, numbers as strings, HTML and plain strings
sort(sortOrder)
- Source:
Performs channeling of sorting based on whether this.data is multidimensional
Parameters:
| Name | Type | Description |
|---|---|---|
sortOrder |
SortOrder | instance of |
Fires:
Events
reportal-table-sort
- Source:
Event reporting that a table has been sorted