Custom onRightClick handler

"onRightClick" event handler allows to set function called when cell is right clicked

</> Source
<!DOCTYPE html>
<!--pro-->
<html>
<head>
	<title>Custom onRightClick handler</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 myGrid;
		function doOnLoad(){
			myGrid = new dhtmlXGridObject('gridbox');
			myGrid.setImagePath("../../../codebase/imgs/");
			myGrid.attachEvent("onRightClick",onButtonClick);
			myGrid.enableAutoWidth(true);
			myGrid.load("../common/gridH_03_context_menu.xml");
		}
		function onButtonClick(rowId,cellId){
			document.getElementById("a_1").style.display="block";
			document.getElementById("a_1").innerHTML="cell ("+rowId+","+cellId+ ") was right clicked";
			return false;
		}
	</script>
</head>
<body onload="doOnLoad()" onresize="return true;" >
	<h1>Custom onRightClick handler</h1>
	<p>"onRightClick" event handler allows to set function called when cell is right clicked</p>
	<div style="height:20px;">
		<div id="a_1" style="color:red;display:none">item was right clicked</div>
	</div>
	<table width="772px">
		<tr>
			<td>
				<div id="gridbox" style="width:100%;height:315px;background-color:white;"></div>
			</td>
		</tr>
	</table>
</body>
</html>

Documentation

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