Function(event, treeId, treeNode)setting.callback.onRightClick

Overview[ depends on jquery.ztree.core js ]

Callback for mouse right click node.

If you set 'setting.callback.beforeRightClick',and return false, zTree will not trigger the 'onRightClick' callback.

If you set 'setting.callback.onRightClick', zTree will shield the browser context menu when mouse right click on zTree.

Default: null

Function Parameter Descriptions

eventjs event Object

event Object

treeIdString

zTree unique identifier: treeId.

treeNodeJSON

JSON data object of the node which is mouse right clicked

If the DOM which mouse right clicked isn't a node, it will return null.

Examples of setting & function

1. When mouse right click node, alert info about 'tId' and 'name'.

function myOnRightClick(event, treeId, treeNode) {
    alert(treeNode ? treeNode.tId + ", " + treeNode.name : "isRoot");
};
var setting = {
	callback: {
		onRightClick: myOnRightClick
	}
};
......