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

Overview[ depends on jquery.ztree.core js ]

Callback for node's DOM is created.

Because v3.x uses lazy loading technology, so the nodes which doesn't create DOM when initialized will not trigger this callback, until its parent node is expanded.

Large amount of data to load, please note: do not set onNodeCreated, can improve performance as when initialized.

Default: null

Function Parameter Descriptions

eventjs event Object

event Object

treeIdString

zTree unique identifier: treeId.

treeNodeJSON

JSON data object of the node which DOM is created

Examples of setting & function

1. When node's DOM is created, alert info about 'tId' and 'name'.

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