# Header API

The Header API provides access to the Header UI component.

Version Availability

This API is available in Sisense for Windows 8.1 and Sisense for Linux L8.2.1 or newer

# Module

Unlike older JavaScript APIs available globally via prism, the Header API is provided as a stand-alone module and needs to be loaded explicitly. See Using API Modules for more information.

Module name: api.v1.header

Example:

var headerApi = prism.getApi('api.v1.header');

# Methods

# isVisible()

Is the header currently displayed

Arguments

N/A

Returns

boolean

# hide()

Hide the header entirely

Arguments

N/A

Returns

N/A

# show()

Show the header

Arguments

N/A

Returns

N/A

# on(eventName, eventHandler)

Subscribe a handler to an application event

Arguments

Param Type Description
eventName string Name of event to subscribe to
eventHandler function Event handler function

Returns

N/A

# off(eventName, eventHandler)

Un-subscribe a handler from an application event

Arguments

Param Type Description
eventName string Name of event to unsubscribe from
eventHandler function Event handler function to remove

Returns

N/A

# getTabs()

Get an array of current header tabs

Arguments

N/A

Returns

Array.<HeaderTab>

# getTab(id)

Get a specific tab

Arguments

Param Type Description
id string tab ID

Returns

HeaderTab

# addTab(tab, [index])

Add one tab

Arguments

Param Type Description
tab HeaderTab Tab
[index] number Index to insert into

Returns

N/A

# addTabs(tabs, [index])

Add multiple tabs

Arguments

Param Type Description
tabs Array.<HeaderTab> Tabs
[index] number Index to insert into

Returns

N/A

# updateTab(tab)

Update one tab - based on tab's ID

Arguments

Param Type Description
tab HeaderTab Tab

Returns

N/A

# removeTab(id)

Remove a specific tab

Arguments

Param Type Description
id string Tab ID

Returns

N/A

# getActiveTab()

Get the current active tab

Arguments

N/A

Returns

HeaderTab

# setActiveTab(id)

Set the current active tab

Arguments

Param Type Description
id string tab ID

Returns

N/A

# getIcon()

Get an array of current header icons

Arguments

N/A

Returns

Array.<HeaderIcon>

# getIcon(id)

Get a specific icon

Arguments

Param Type Description
id string Icon ID

Returns

HeaderIcon

# addIcon(icon, [index])

Add one icon

Arguments

Param Type Description
icon HeaderIcon Icon
[index] number Index to insert into

Returns

N/A

# addIcons(icons, [index])

Add multiple icons

Arguments

Param Type Description
icons Array.<HeaderIcon> Icons
[index] number Index to insert into

Returns

N/A

# updateIcon(icon)

Update one icon - based on icon's ID

Arguments

Param Type Description
icon HeaderIcon Icon

Returns

N/A

# removeIcon(id)

Remove a specific icon

Arguments

Param Type Description
id string Icon ID

Returns

N/A

Get current logo settings

Arguments

N/A

Returns

HeaderLogo

# updateLogo(logoSettings)

Update the header logo

Arguments

Param Type Description
logoSettings HeaderLogo new logo configuration

Returns

N/A

Hide the header logo

Arguments

N/A

Returns

N/A

Show the header logo

Arguments

N/A

Returns

N/A

# getHeaderElement()

Get the entire header's DOM element

Arguments

N/A

Returns

DOMElement

# Types

# HeaderTab

A header tab item

Properties

Name Type Description
id string unique ID
title string Tab's text
[url] string URL the tab should navigate to

# HeaderIcon

A header icon item

Properties

Name Type Description
id string unique ID
icon string URL of icon (SVG or PNG)
[counter] number notification counter - if set to null or 0 will not be shown

The header logo

Properties

Name Type Description
url string URL to which the logo links
image string URL of logo image

# Events

# "created"

Fires when the header is created

Properties

Name Type Default Description
eventName string 'created' event name

# "destroyed"

Fires when the header is destroyed

Properties

Name Type Default Description
eventName string 'destroyed' event name

# "hidden"

Fires when the header is hidden

Properties

Name Type Default Description
eventName string 'hidden' event name

# "shown"

Fires when the header is shown

Properties

Name Type Default Description
eventName string 'shown' event name

# "logoaction"

Fires when the header logo element is clicked

Properties

Name Type Default Description
eventName string 'logoaction' event name

# "tabaction"

Fires when a header navigation tab element is clicked

Properties

Name Type Default Description
eventName string 'tabaction' event name
tab HeaderTab the tab that was clicked

# "iconaction"

Fires when a header icon item element is clicked

Properties

Name Type Default Description
eventName string 'iconaction' event name
icon HeaderIcon the icon that was clicked