WTUI Docs

WTUI  1.0.0

WTUI Docs > WTUI > WTUI.TabPanel
Search:
 
Filters

Class WTUI.TabPanel

A Tab Panel

Tag

<wtui:panel/>

The tag for WTUI.TabPanel

Example:

<wtui:tabpanel id="examplepanel">
  <wtui:tab title="Tab One">
    <wtui:paragraph>A paragraph in tab one</wt:paragraph>
  </wtui:tab>
  <wtui:tab title="Tab Two">
    <wtui:paragraph>A paragraph in tab two</wt:paragraph>
  </wtui:tab>
</wtui:tabpanel>
Parameters:
id <String> (optional) The id of the panel
class <String> (optional) The css class to give the panel
style <String> (optional) The style to give the panel

Methods

getCurrentTab

Number getCurrentTab ( )

Get the index of the current tab

Returns: Number
The index of the current tab (First tab is 0)

getTabCount

Number getTabCount ( )

Get number of tabs

Returns: Number
The number of tabs

getTabVisible

Boolean getTabVisible ( index )

Return true if a tab is visible

Parameters:
index <Number> The index of the tab (First tab is 0)
Returns: Boolean
Returns true if the tab is visible

setEnabled

void setEnabled ( index , enabled )

Enable or disable a tab

Parameters:
index <Number> The index of the tab (First tab is 0)
enabled <Boolean> Set to true to enable the tab
Returns: void

setTabVisible

void setTabVisible ( index , visible )

Show or hide a tab

Parameters:
index <Number> The index of the tab (First tab is 0)
visible <Boolean> Set to true to show the tab
Returns: void

showTab

void showTab ( index )

Switch to a tab

Parameters:
index <Number> The index of the tab (First tab is 0)
Returns: void

Events

tabblur

tabblur ( from , to )
Fired when a tab is about to change, return false to stop the tabs from switching

Example:
WTUIComponent('tabpanelid').on('tabblur', function() {
  alert('The tab is about to change');
});
Parameters:
from <object> (String) the tab to switch from
to <object> (String) the tab to switch to

tabfocus

tabfocus ( to )
Fired when a tab has changed

Example:
WTUIComponent('tabpanelid').on('tabfocus', function() {
  alert('The tab has changed');
});
Parameters:
to <object> (String) the tab switched to

WTUI