onContentLoaded event

onContentLoaded
logs
</> Source
<!DOCTYPE html>
<html>
<head>
	<title>onContentLoaded event</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: 700px;
			height: 600px;
		}
		div.info {
			margin: 0px 10px;
			font-weight: bold;
			font-size: 15px;
			color: #3b5e7c;
		}
		div#logsHere {
			position: relative;
			height: 100px;
			border: #dfdfdf 1px solid;
			padding: 4px;
			margin: 30px 10px 10px 10px;
			font-size: 14px;
			font-family: Roboto, Arial, Helvetica;
			color: #404040;
			overflow: auto;
		}
		/* attached */
		h3.some_header {
			padding-left: 10px;
			padding-right: 10px;
			font-family: Roboto, Arial, Helvetica;
			color: #404040;
		}
		div.some_text {
			padding-left: 10px;
			padding-right: 10px;
			font-size: 14px;
			font-family: Roboto, Arial, Helvetica;
			color: #404040;
		}
	</style>
	<script>
		var mainLayout, layout2E;
		function doOnLoad() {
			mainLayout = new dhtmlXLayoutObject({
				parent: "layoutObj",
				pattern: "3L"
			});

			mainLayout.forEachItem(function(cell){
				cell.setText("mainLayout ["+cell.getId()+"]");
			});
			mainLayout.attachEvent("onContentLoaded", function(name){
				writeLog("event onContentLoaded called for mainLayout, cell "+name);
			});

			// iframe, get
			mainLayout.cells("a").attachURL("../../../dhtmlxWindows/samples/common/test_page_1.html");
			// iframe, post
			mainLayout.cells("b").attachURL("../../../dhtmlxWindows/samples/common/test_page_2.html", false, true);

			// second layout
			layout2E = mainLayout.cells("c").attachLayout("2U");
			layout2E.forEachItem(function(cell){
				cell.setText("layout2E ["+cell.getId()+"]");
			});
			layout2E.attachEvent("onContentLoaded", function(name){
				writeLog("event onContentLoaded called for layout2E, cell "+name);
			});
			// ajax, get
			layout2E.cells("a").attachURL("../../../dhtmlxWindows/samples/common/test_page_1.html");
			// ajax, post
			layout2E.cells("b").attachURL("../../../dhtmlxWindows/samples/common/test_page_2.html", true, true);
		}
		function writeLog(text) {
			document.getElementById("logsHere").innerHTML += "<br>"+text;
			document.getElementById("logsHere").scrollTop = document.getElementById("logsHere").scrollHeight;
		}
		function doOnUnload() {
			if (mainLayout != null && mainLayout.unload != null) {
				mainLayout.unload();
				mainLayout = layout2E = null;
			}
		}
	</script>
</head>
<body onload="doOnLoad();" onunload="doOnUnload();">
	<div class="info">
		<div class="info_title">onContentLoaded</div>
	</div>
	<div id="layoutObj"></div>
	<div id="logsHere">logs</div>
</body>
</html>

Documentation

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