Function(treeId, treeNode)setting.callback.beforeCollapse

Overview[ depends on jquery.ztree.core js ]

Specify callback function to be called before collapse node, The return value controls the collapse node.

Default: null

Function Parameter Descriptions

treeIdString

zTree unique identifier: treeId.

treeNodeJSON

JSON data object of the node to be collapsed

Return Boolean

return true or false

If return false, zTree will not collapse node, and will not trigger the 'onCollapse' callback.

Examples of setting & function

1. disabled to collapse node which is expanded

function myBeforeCollapse(treeId, treeNode) {
    return false;
};
var setting = {
	callback: {
		beforeCollapse: myBeforeCollapse
	}
};
......