## Function(treeId, treeNode, clickFlag)setting.callback.beforeClick

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

Used to capture the event before click node, zTree based on return value to determine whether to trigger the 'onClick' callback.

Default: null

### Function Parameter Descriptions

#### treeId String

zTree unique identifier: treeId, easy for users to control.

#### 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 | 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

#### Return Boolean

return true or false

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

### Examples of setting & function

#### 1. disabled to click the node

    function zTreeBeforeClick(treeId, treeNode, clickFlag) {
        return (treeNode.id !== 1);
    };
    var setting = {
    	callback: {
    		beforeClick: zTreeBeforeClick
    	}
    };
    ......