ztree获取选中节点

  $(document).ready(function(){
            $.fn.zTree.init($("#treeDemo"), setting, zNodes);
        });
            
            function onCheck(e,treeId,treeNode){
            var treeObj=$.fn.zTree.getZTreeObj("treeDemo"),
            nodes=treeObj.getCheckedNodes(true),
            v="";
            for(var i=0;i){
            v+=nodes[i].name + ",";
            alert(nodes[i].id); //获取选中节点的值
            }
            
            
            }
            

你可能感兴趣的:(ztree)