Search
TabControl.tabHeaderClick Event
See Also
 






Raised when a tab header is clicked.

Namespace: MindFusion.Common.UI
File: TabControl.js

 Syntax

JavaScript  Copy Code

EventDispatcher tabHeaderClick

 Event Data

The event handler method receives the following arguments:
sender
A TabPage instance, which is the source of the event. This object will be passed to the handler function as the first argument.
args
An ItemEventArgs instance, which contains event data. This object will be passed to the handler function as the second argument.

 Example

The following code creates a new instance of the TabControl class using a reference to an HTMLElement called tabcontrol. It handles the tabHeaderClick event:

JavaScript  Copy Code

// create a new instance of the TabControl control
var tabControl = new ui.TabControl(document.getElementById("tabcontrol"));
tabControl.width = tabControl.height = new ui.Unit(100, ui.UnitType.Percent);
tabControl.theme = "standard";
tabControl.tabHeaderClick.addEventListener(handleTabHeaderClick);

...........................
...........................

function handleTabHeaderClick(sender, args)
{
 if (sender.title == "+")
 {
    addEmptyPage();
 }
 else if (sender.data == -1)
 {
  if (tabControl.selectedItem === tabPage2)
     tabControl.selectedIndex = 1;
 }
}

 See Also