TabPanel Class

Standard tab control used to show/hide individual panels.

Constructors

TabPanel( parent, config )
Used to instantiate this class
parentDOM element in which to render this component
configConfiguration settings (optional). See config options for more information.

Config Options

closable
If true, will insert a "close" icon into the tab that will allow users to close/remove the tab from the tab panel.
style
Style for individual elements within the component. Note that you can provide CSS class names instead of individual style definitions.

Events

onTabChange( currTab, prevTab )
Called whenever a tab is raised.

Public Methods

addTab( label, el )
Used to add a new tab to the panel.
labelTab title.
elTab contents. Rendered when the tab is active. Accepts strings, DOM elements, and nulls
getTabs( )
Returns an of tabs in the tab panel. Each entry in the array will include the following:
  • name: Name of the tab and tab label
  • header: DOM element for the tab header
  • body: DOM element for the tab content
  • hidden: Boolean
  • active: Boolean
raiseTab( id )
Used to raise a tab
idAccepts a tab index (stating at 0) or a tab name
removeTab( id )
Used to remove a tab from the tab panel.
idAccepts a tab index (stating at 0) or a tab name
hideTab( id )
Used to hide a tab in the tab panel. Unlike the removeTab() method, the tab will remain in the tab panel, but in a hidden state.
idAccepts a tab index (stating at 0) or a tab name
showTab( id )
Used to make a hidden tab visible. See hideTab()
idAccepts a tab index (stating at 0) or a tab name