OTable(el)

Global Function

Initialises an o-table components inside the element passed as the first parameter

parameter type default description
el (optional) HTMLElement | string document.body Element where to search for the o-table component. You can pass an HTMLElement or a selector string

Returns

  • OTable - - A single OTable instance

Links

OTable#dispatch(...)

Instance Method

Helper function to dispatch namespaced events, namespace defaults to oTable

parameter type default description
event String
data Object {}
namespace String 'oTable'

Links

OTable#getTableHeader

Instance Method

Gets a table header for a given column index.

Returns

  • element | null - - The header element for the requested column index.

Links

OTable#removeEventListeners

Instance Method

Helper function to remove all event handlers which were added during instantiation of the component

Returns

  • undefined

Links

OTable#sortRowsByColumn(...)

Instance Method

Sorts the table by a specific column

parameter type default description
The number index of the column to sort the table by
Which bool direction to sort in, ascending or descending
Whether bool the values in this column are numeric, if they are numeric we convert the contents into numbers

Returns

  • - undefined

Links

OTable#sorted(columnIndex, sort)

Instance Method

Indicated that the table has been sorted by firing by a custom sort implementation. Fires the oTable.sorted event.

parameter type default description
columnIndex number | null The index of the currently sorted column, if any.
sort string | null The type of sort i.e. ASC or DES, if any.

Links

<anonymous>~customSort

Inner Property

Check if sorting has been cancelled on this table in favour of a custom implementation. The return value is false if event is cancelable and at least one of the event handlers which handled this event called Event.preventDefault(). Otherwise it returns true. https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/dispatchEvent

Links

OTable#destroy

Instance Method

Destroys the instance, removing any event listeners that were added during instatiation of the component

Returns

  • - undefined

Links

OTable.init(el)

Static Method

Initialises all o-table components inside the element passed as the first parameter

parameter type default description
el (optional) HTMLElement | string document.body Element where to search for o-table components. You can pass an HTMLElement or a selector string

Returns

  • Array | OTable - - An array of OTable instances or a single OTable instance

Links

OTable(el)

Global Function

Initialises an o-table components inside the element passed as the first parameter

parameter type default description
el (optional) HTMLElement | string document.body Element where to search for the o-table component. You can pass an HTMLElement or a selector string

Returns

  • OTable - - A single OTable instance

Links