Dock/undock cells

Item:
</> Source
<!DOCTYPE html>
<html>
<head>
	<title>Dock/undock cells</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>
	<style>
		div#layoutObj {
			position: relative;
			margin-top: 10px;
			margin-left: 10px;
			width: 500px;
			height: 300px;
		}
		div#winVP {
			position: relative;
			height: 400px;
			border: #c0c0c0 1px solid;
			border-radius: 2px;
			margin: 10px;
		}
	</style>
	<script>
		var myLayout;
		var sel;
		var myGrid,myMenu,myToolbar;
		function doOnLoad() {
			
			myLayout = new dhtmlXLayoutObject({
				parent: "layoutObj",
				pattern: "2U"
			});
			
			// change window's viewport
			myLayout.dhxWins.attachViewportTo("winVP");
			
			sel = document.getElementById("sel");
			myLayout.forEachItem(function(item){sel.options.add(new Option(item.getId(),item.getId()));});
			
			myMenu = myLayout.cells("a").attachMenu({
				icons_path: "../../../dhtmlxMenu/samples/common/imgs/",
				xml: "../../../dhtmlxMenu/samples/common/dhxmenu.xml"
			});
			
			myGrid = myLayout.cells("a").attachGrid();
			myGrid.setImagePath("../../../codebase/imgs/")
			myGrid.load("../common/grid.xml");
		}
		function getId() {
			var sel = document.getElementById("sel");
			var id = sel.options[sel.selectedIndex].value;
			return id;
		}
		function dockCell() {
			myLayout.cells(getId()).dock();
		}
		function undockCell() {
			myLayout.cells(getId()).undock(550,20,400,300);
		}
	</script>
</head>
<body onload="doOnLoad();">
	<div id="winVP">
		<div id="layoutObj"></div>
	</div>
	<div style="margin-left: 10px; margin-top:20px;">
		Item: <select id="sel"></select>
		<input type="button" value="dock" onclick="dockCell();">
		<input type="button" value="undock" onclick="undockCell();">
	</div>
</body>
</html>

Documentation

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