zTree v3.x provides this method to get zTree object from the tree's Id.
Please initialize zTree first, then you can use this method.
Users don't need to use a global variable to reference the zTree object, as all of the callback methods will pass 'treeId' parameters, and you can always call this method to get the zTree object.
zTree unique identifier
zTree object
This is a reference to the zTree object.
var treeObj = $.fn.zTree.getZTreeObj("tree");