## Function(event, treeId, treeNode, clickFlag)setting.callback.onClick

### Overview[ depends on jquery.ztree.core js ]

Used to capture the click event when click node.

If you set 'setting.callback.beforeClick',and return false, zTree will not change selected state, and will not trigger the 'onClick' callback.

Default: null

### Function Parameter Descriptions

#### event js event Object

event Object

#### treeId String

zTree unique identifier: treeId.

#### treeNode JSON

JSON data object of the node which is clicked

#### clickFlag Number

Node is selected or deselected state, please see table below for details

clickFlag | selectedMulti | autoCancelSelected && event.ctrlKey / metaKey | isSelected | operate for selected
1 | true | false | false | node is selected (single)
1 | true | false | true | node is selected (single)
2 | true | true | false | node is selected (multi)
0 | true | true | true | node is deselected
1 | false | false | false | node is selected (single)
1 | false | false | true | node is selected (single)
1 | false | true | false | node is selected (single)
0 | false | true | true | node is deselected

### Examples of setting & function

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

    function myOnClick(event, treeId, treeNode) {
        alert(treeNode.tId + ", " + treeNode.name);
    };
    var setting = {
    	callback: {
    		onClick: myOnClick
    	}
    };
    ......