Ztree only gets an array of nodes that are currently selected or unchecked.

The official document of

ztree only gives a collection of canceled or selected nodes of all nodes. Now I just want to get the id and status of the node of the currently selected item. What can I do?
Code:

 //
    function zTreeOnCheck(event, treeId, treeNode) {
        
        var treeObj = $.fn.zTree.getZTreeObj(treeId);       
        var nodesSelect = treeObj.getCheckedNodes();
        var    nodes1 = treeObj.getChangeCheckedNodes();
      
        var    status = treeObj.getNodes().checked;
        
        var nodes = treeObj.transformToArray(treeObj.getNodes()); 
    
        $.each(nodes1, function(i, item){
     
//                 nodeList.push(item.id);
                console.log(item.checked);
       
        });
        
        treeObj.updateNode();
        

             
    }

all these methods have been tried, but none of them work. Who knows what to do?

Mar.16,2021

getSelectedNodes, gets all selected nodes

Menu