English | Site Directory

gadgets.TabSet

 SUMMARY     DETAIL

Class gadgets.TabSet

A class gadgets can use to make tabs.

Constructor Summary

gadgets.TabSet(opt_moduleId, opt_defaultTab, opt_container)
Creates a new TabSet object
 

Method Summary

 String addTab(tabName, opt_params)
Adds a new tab based on the name-value pairs specified in opt_params.
alignTabs(align, opt_offset)
Sets the alignment of tabs.
displayTabs(display)
Shows or hides tabs and all associated content.
 Element getHeaderContainer()
Returns the tab headers container element.
 gadgets.Tab getSelectedTab()
Returns the currently selected tab object.
 Array.<gadgets.Tab> getTabs()
Returns an array of all existing tab objects.
removeTab(tabIndex)
Removes a tab at tabIndex and all of its associated content.
setSelectedTab(tabIndex)
Selects the tab at tabIndex and fires the tab's callback function if it exists.
swapTabs(tabIndex1, tabIndex2)
Swaps the positions of tabs at tabIndex1 and tabIndex2.
 

Constructor Detail

gadgets.TabSet

gadgets.TabSet(opt_moduleId, opt_defaultTab, opt_container)
    Creates a new TabSet object
    Parameters:
      String opt_moduleId - Optional suffix for the ID of tab container.
      String opt_defaultTab - Optional tab name that specifies the name of of the tab that is selected after initialization. If this parameter is omitted, the first tab is selected by default.
      Element opt_container - The HTML element to contain the tabs. If omitted, a new div element is created and inserted at the very top.

Method Detail

addTab

String addTab(tabName, opt_params)
    Adds a new tab based on the name-value pairs specified in opt_params.
    Parameters:
      String tabName - Label of the tab to create.
      Object opt_params - Optional parameter object. The following properties are supported: .contentContainer An existing HTML element to be used as the tab content container. If omitted, the tabs library creates one. .callback A callback function to be executed when the tab is selected. .tooltip A tooltip description that pops up when user moves the mouse cursor over the tab. .index The index at which to insert the tab. If omitted, the new tab is appended to the end.
    Returns:
      String DOM id of the tab container.

alignTabs

alignTabs(align, opt_offset)
    Sets the alignment of tabs. Tabs are center-aligned by default.
    Parameters:
      String align - 'left', 'center', or 'right'.
      Number opt_offset - Optional parameter to set the number of pixels to offset tabs from the left or right edge. The default value is 3px.

displayTabs

displayTabs(display)
    Shows or hides tabs and all associated content.
    Parameters:
      Boolean display - true to show tabs; false to hide tabs.

getHeaderContainer

Element getHeaderContainer()
    Returns the tab headers container element.
    Returns:
      Element The tab headers container element.

getSelectedTab

gadgets.Tab getSelectedTab()
    Returns the currently selected tab object.
    Returns:
      gadgets.Tab The currently selected tab object.

getTabs

Array.<gadgets.Tab> getTabs()
    Returns an array of all existing tab objects.
    Returns:
      Array.<gadgets.Tab> Array of all existing tab objects.

removeTab

removeTab(tabIndex)
    Removes a tab at tabIndex and all of its associated content.
    Parameters:
      Number tabIndex - Index of the tab to remove.

setSelectedTab

setSelectedTab(tabIndex)
    Selects the tab at tabIndex and fires the tab's callback function if it exists. If the tab is already selected, the callback is not fired.
    Parameters:
      Number tabIndex - Index of the tab to select.

swapTabs

swapTabs(tabIndex1, tabIndex2)
    Swaps the positions of tabs at tabIndex1 and tabIndex2. The selected tab does not change, and no callback functions are called.
    Parameters:
      Number tabIndex1 - Index of the first tab to swap.
      Number tabIndex2 - Index of the secnod tab to swap.

Documentation generated by JsDoc Toolkit 1.3.3