Search
SelectedItemChangingEventArgs.newItem Property
See Also
 






Gets the new selected item.

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

 Syntax

JavaScript  Copy Code

get newItem() {}

 Property Value

ListItem. The new selected item.

 Example

The following code creates a new TabControl and handles its selectedItemChanging 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";


var tab = new ui.TabPage("«");
tab.header.size = new ui.Unit(20);
tab.header.interactive = false;
tab.header.tooltip = "Previous Tab";
tab.data = -1;
tab.navigateUrl = "products.html";
tab.templateUrl = "Window1.html";
tab.allowClose = false;

tabControl.tabs.add(tab);


tabControl.selectedItemChanging.addEventListener(tabControlEventHandler);


function tabControlEventHandler(sender, args)
{
 if(args.newItem.data == 1")
 {
      //cancel the action
      args.cancel = true;
 }
}

 See Also