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

Overview[ depends on jquery.ztree.core js ]

Used to capture the event when collapse node.

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

Default: null

Function Parameter Descriptions

eventjs event Object

event Object

treeIdString

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

treeNodeJSON

JSON data object of the node which will be collapsed

Examples of setting & function

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

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