onOpen / onClose

onOpen / onClose











</> Source
<!DOCTYPE html>
<html>
<head>
	<title>onOpen / onClose</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>
		#log_here {
			font-size: 8pt;
			font-family: Tahoma;
			width: 500px;
			height: 120px;
			border: 1px solid #cecece;
			padding: 2px 5px;
			overflow: auto;
		}
	</style>
	<script>
		var myCombo;
		var eventIndex = 1;
		function doOnLoad() {
			myCombo = new dhtmlXCombo("combo_zone", null, null, "image");
			myCombo.setImagePath("../common/flags/");
			myCombo.load("../common/data_countries.json");
			myCombo.attachEvent("onOpen", function(){
				log("onOpen");
			});
			myCombo.attachEvent("onClose", function(){
				log("onClose");
			});
		}
		function log(text) {
			var t = document.getElementById("log_here");
			t.innerHTML += (eventIndex++)+") "+text+"<br>";
			t.scrollTop = t.scrollHeight;
		}
	</script>
</head>
<body onload="doOnLoad();">
	<h3>onOpen / onClose</h3>
	<div id="combo_zone" style="width:230px;"></div>
	<br><br><br><br><br><br><br><br><br><br>
	<div id="log_here"></div>
</body>
</html>

Documentation

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