Search
TabControl.selectedItemChanged Event
See Also
 






Raised when the selected tab is changed.

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

 Syntax

JavaScript  Copy Code

EventDispatcher selectedItemChanged

 Event Data

The event handler method receives the following arguments:
sender
A TabControl instance, which is the source of the event. This object will be passed to the handler function as the first argument.
args
A SelectedItemChangedEventArgs 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 TabControl and handles its selectedItemChanged 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.tabStripSize = new ui.Unit(100, ui.UnitType.Pixel);
tabControl.theme = "standard";

tabControl.selectedItemChanged.addEventListener(tabControlSelectedItemChanged);


function tabControlSelectedItemChanged(sender, args)
{
  if(args.oldItem.text == "First Tab")
  {
       //do something
  }
}

 See Also