The TabControl represents a container of items, whose contents are displayed in the same area. The TabPage control derives from WindowBase and represents a window with header and content. The content of only one of the tabs in the TabControl is displayed at a time. Server side
Client side- Getting a reference to the control
You can access the control on the client side by its ClientID.
JavaScript
Copy Code
|
---|
var tabControl = $find("TabControl1"); var tabControl = $find("<%= TabControl1.ClientID %>"); |
- Accessing tabs
Use the getAllTabs method to get a reference to the control's tabs array. Use the getActiveTab method to access the currently displayed tab.
- Changing the current tab
Use selectTab or selectTabByIndex methods to select the specified tab.
JavaScript
Copy Code
|
---|
tabControl.selectTab(tabControl.getAllTabs()[2]); tabControl.selectTabByIndex(2); |
- Adding tabs
Use the TabControl.createTab method to add a new tab to its tabs array. The createTab method accepts as parameter a JSON object, containing the data for the new tab. Use the data object to define values for the properties and events, exposed by the TabPage class.
JavaScript
Copy Code
|
---|
tabControl.createTab({ properties: { navigateUrl: "http://www.mindfusion.eu" }, events: { frameLoaded: onTabPageFrameLoaded} }); |
- Removing tabs
Use the TabControl.deleteTab method to remove a specified tab from the array.
JavaScript
Copy Code
|
---|
tabControl.deleteTab(tabControl.getAllTabs()[0]); |
- Events
The following client-side events are exposed by the TabControl class.
The following client-side events are exposed by the TabPage class.
|