OnContextMenu: function (sender, args);
sender. Event source.
args. Event information.
The OnContextMenu event occurs on calling context menu of the component.
For the event to occur, the parameter of the Control.setDraggable method must be set to true.
To execute the example, connect the PP.js library and the PP.css visual styles table. Create a button, on context menu calling of which brings up the Context Menu is pressed message:
<script type="text/javascript">
function ContMen(data) {
this.data = data;
this.onContMen = function (sender, args)//ContextMenu event handler
{
alert("Context Menu is pressed");
}
}
var CM = new ContMen("ContextMenu event example");
var b1 = new PP.Ui.Button({
Content: "Button",
OnContextMenu: CM.onContMen});
b1.addToNode("btn1");
b1.setDraggable(true);
</script>
After executing the example on calling the component context menu the Context Menu is pressed message is displayed.
See also: