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

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

Before click callback, return false to prevent the 'onClick' callback.

Default: null

### Function Parameter Descriptions

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

#### 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 myBeforeClick(treeId, treeNode, clickFlag) {
        return (treeNode.id !== 1);
    };
    var setting = {
    	callback: {
    		beforeClick: myBeforeClick
    	}
    };
    ......