Control over tabs


For active tab:


For selected tab:



</> Source
<!DOCTYPE html>
<html>
<head>
	<title>Control over tabs</title>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
	<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
	<link rel="stylesheet" type="text/css" href="../../../codebase/fonts/font_roboto/roboto.css"/>
	<link rel="stylesheet" type="text/css" href="../../../codebase/dhtmlx.css"/>
	<script src="../../../codebase/dhtmlx.js"></script>
	<script>
		var myTabbar;
		function doOnLoad() {
			myTabbar = new dhtmlXTabBar("my_tabbar");
			myTabbar.addTab("a1", "Tab 1-1", null, null, true);
			myTabbar.addTab("a2", "Tab 1-2");
			myTabbar.addTab("a3", "Tab 1-3");
			myTabbar.addTab("a4", "Tab 1-4");
			myTabbar.addTab("a5", "Tab 1-5");
		}
	</script>

</head>
<body onload="doOnLoad();">
	<div id="my_tabbar" style="width:495px; height:190px;"></div>

	<br>
	For active tab:
	<br>

	<input type="button" value="Set tab label" onclick="var id=myTabbar.getActiveTab();if(id!=null)myTabbar.cells(id).setText(document.getElementById('new_label').value);">
	<input type="text" value="new label" id="new_label">

	<br><br>

	For selected tab:
	<br><br>

	<select id="sel_1">
		<option value="a1">a1</option>
		<option value="a2">a2</option>
		<option value="a3">a3</option>
		<option value="a4">a4</option>
		<option value="a5">a5</option>
	</select>
	<input type="button" value="Disable tab" onclick="myTabbar.tabs(document.getElementById('sel_1').value).disable(true);">
	<input type="button" value="Enable tab" onclick="myTabbar.tabs(document.getElementById('sel_1').value).enable();">

	<br><br>

	<select id="sel_2">
		<option value="a1">a1</option>
		<option value="a2">a2</option>
		<option value="a3">a3</option>
		<option value="a4">a4</option>
		<option value="a5">a5</option>
	</select>
	<input type="button" value="Hide tab" onclick="myTabbar.tabs(document.getElementById('sel_2').value).hide(true);">
	<input type="button" value="Show tab" onclick="myTabbar.tabs(document.getElementById('sel_2').value).show();">
</body>
</html>


Documentation

Check documentation to learn how to use the components and easily implement them in your applications.