TableHeader

Drupal. TableHeader

new TableHeader(table)

Source:
Constructor for the tableHeader object. Provides sticky table headers. TableHeader will make the current table header stick to the top of the page if the table is very long.
Parameters:
Name Type Description
table HTMLElement DOM object for the table to add a sticky header to.
Listens to Events:

Members

(static) tables :Array.<Drupal.TableHeader>

Source:
This will store the state of all processed tables.
Type:

$originalTable :HTMLElement

Source:
Type:
  • HTMLElement

minHeight :number

Source:
Minimum height in pixels for the table to have a sticky header.
Type:
  • number

stickyVisible :bool

Source:
Boolean storing the sticky header visibility state.
Type:
  • bool

(nullable) tableHeight :number

Source:
Absolute position of the table on the page.
Type:
  • number

(nullable) tableOffset :Drupal~displaceOffset

Source:
Absolute position of the table on the page.
Type:

Methods

checkStickyVisible() → {bool}

Source:
Returns true if sticky is currently visible.
Returns:
The visibility status.
Type
bool

createSticky()

Source:
Create the duplicate header.

onScroll(e)

Source:
Check if sticky header should be displayed. This function is throttled to once every 250ms to avoid unnecessary calls.
Parameters:
Name Type Description
e jQuery.Event The scroll event.

recalculateSticky(event)

Source:
Event handler: recalculates position of the sticky table header.
Parameters:
Name Type Description
event jQuery.Event Event being triggered.

stickyPosition(offsetTop, offsetLeft) → {jQuery}

Source:
Set absolute position of sticky.
Parameters:
Name Type Description
offsetTop number The top offset for the sticky header.
offsetLeft number The left offset for the sticky header.
Returns:
The sticky table as a jQuery collection.
Type
jQuery