onKeyPressed
onKeyPressed
</> Source
<!DOCTYPE html>
<html>
<head>
<title>onKeyPressed</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, "checkbox");
myCombo.load("../common/data2.json");
myCombo.attachEvent("onKeyPressed", function(code){
log("onKeyPressed event, key code: "+code);
return true;
});
}
function log(text) {
var t = document.getElementById("log_here");
t.innerHTML += (eventIndex++)+") "+text+"<br>";
t.scrollTop = t.scrollHeight;
}
</script>
</head>
<body onload="doOnLoad();">
<h3>onKeyPressed</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.