Search
TabControl.selectedItem Property
See Also
 






Gets or sets the currently selected tab page.

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

 Syntax

JavaScript  Copy Code

get selectedItem() {}

 Property Value

TabPage. The selected tab page.

 Example

The following code creates a new TabControl, handles its tabHeaderClick event and checks, which the selected TabPage is:

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