Function(key, value, parentNode)zTreeObj.getNodeByParam

Overview[ depends on jquery.ztree.core js ]

According to the node data attribute, search the node which exactly matches, and get the JSON object of node.

Please use zTree object to executing the method.

Function Parameter Descriptions

keyString

The name of attribute which need to exactly match

value?

The value which need to exactly match, can be any type, please ensure its type consistent with the attribute values.

parentNodeJSON

The search range, you can search node from a parent node's child nodes.

If this parameter is omitted, zTree will search node from all nodes.

Return JSON

JSON data object of the node which be searched.

1. If search none node, return null.

2. If there are many nodes can be searched, return the first node.

Examples of function

1. Search the node which its 'id' attribute is 1.

var treeObj = $.fn.zTree.getZTreeObj("tree");
var node = treeObj.getNodeByParam("id", 1, null);