Tab

The Tab Class provides properties, methods, and events to interface with the HTML generated by the <silk:Tag> tag.

Kind: global class

Constructor

new Tab(id, option)

Returns a Tile instance.

Param
Type
Description

id

String

Unique identifier.

option

Object

Object containing the configuration.

Methods

addTab(id, title, content, silent) ⇒ Integer

Adds a new tab to the tab group. If other tabs exist, the tab will be added to the right of the last It is automatically selected, unless the silent parameter is set to true. Returns the index of the newly created

Kind: instance method of Tab

Param
Type
Description

id

String

The tab's unique identifier

title

String

The tab's title

content

String

The tab's content

silent

Boolean

Optional. If set to true the tab will not get selected.

getActive() ⇒ Object

Returns the active or selected tab object. If a parameter is provided, it searches for the tab using the provided index or ID and returns the tab object.

Kind: instance method of Tab Parma: Integer|String x - The tab index or id. If not provided, uses the selected.

getSelectedTab() ⇒ Object

Returns the selecte tab item.

Kind: instance method of Tab

getTabs() ⇒ Array

Returns the array containing the tabs.

Kind: instance method of Tab

getVisible() ⇒ object

Return if the tab is visible

Kind: instance method of Tab Parma: Integer|String x - The tab index or id. If not provided uses the selected

hide()

Hiddes the tab component.

Kind: instance method of Tab

hideTab()

Returns the selecte tab item.

Kind: instance method of Tab Parma: Integer|String Tab index or id. If not provided uses the selected

indexOf(id) ⇒ Integer

Returns the index of the tab with the provided id.

Kind: instance method of Tab

Param
Type
Description

id

Integer

The tab's id.

on

Load events to respond to the Tab's interactions. To set an event, use this code: Tab.on(<eventName>, function(){<code>}).

Kind: instance property of Tab

Param
Type
Description

eventName

String

The event's name.

eventFunction

function

The function to be triggered.

removeTab(index)

Removes the tab based on the provided index.

Kind: instance method of Tab

Param
Type
Description

index

Integer

The index to be removed.

setIndex(index)

Activates a tab based on the provided index

Kind: instance method of Tab

Param
Type
Description

index

Integer

The tab index

show()

Show the tab component.

Kind: instance method of Tab

showTab(Tab)

Show a tab item that is being hidden.

Kind: instance method of Tab

Param
Type
Description

Tab

Integer | String

index or id. If not provided uses the selected

toggle(value)

Toggles the component's visibility. If a parameter is provided, true shows the component, false hides the component.

Kind: instance method of Tab

Param
Type
Description

value

Boolan

The logic value.

toggleTab(x, value)

Toggles the tab item's visibility. If a parameter is provided, true shows the tab, false hides the

Kind: instance method of Tab

Param
Type
Description

x

Integer | String

The tab index or id. If not provided uses the selected

value

Boolean

The logic value

Events

on:add

This event is triggered when a tab is added. Created with the Tab.on("add", function(){index}); method.

Kind: event emitted by Tab

on:click

This event is triggered when the tab is clicked. Created with the Tab.on("click", function(index, tabID, clickTarget){}); method.

Kind: event emitted by Tab

on:removed

This event is triggered when a tab is removed. Created with the Tab.on("removed", function(){index}); method.

Kind: event emitted by Tab

Last updated