{"action":"opened","issue":{"url":"https://api.github.com/repos/zTree/zTree_v3/issues/128","labels_url":"https://api.github.com/repos/zTree/zTree_v3/issues/128/labels{/name}","comments_url":"https://api.github.com/repos/zTree/zTree_v3/issues/128/comments","events_url":"https://api.github.com/repos/zTree/zTree_v3/issues/128/events","html_url":"https://github.com/zTree/zTree_v3/issues/128","id":129360809,"number":128,"title":"ztree生成多颗树时的问题","user":{"login":"alex86gbk","id":1990992,"avatar_url":"https://avatars.githubusercontent.com/u/1990992?v=3","gravatar_id":"","url":"https://api.github.com/users/alex86gbk","html_url":"https://github.com/alex86gbk","followers_url":"https://api.github.com/users/alex86gbk/followers","following_url":"https://api.github.com/users/alex86gbk/following{/other_user}","gists_url":"https://api.github.com/users/alex86gbk/gists{/gist_id}","starred_url":"https://api.github.com/users/alex86gbk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alex86gbk/subscriptions","organizations_url":"https://api.github.com/users/alex86gbk/orgs","repos_url":"https://api.github.com/users/alex86gbk/repos","events_url":"https://api.github.com/users/alex86gbk/events{/privacy}","received_events_url":"https://api.github.com/users/alex86gbk/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-01-28T06:56:27Z","updated_at":"2016-01-28T06:56:27Z","closed_at":null,"body":"为了减少id关联，我没有给要显示ztree的DOM加上id。一律用的是父层的节点查找的，如下：\r\n\r\n```\r\nvar $modal =$('#modal');\r\nvar $ztreeNode = $modal.find('.ztree-multiselect .selections');\r\n$.fn.zTree.init($ztreeNode, setting, data);\r\n```\r\n\r\n**以上方式在单独生成一棵树时是好的，但同时生成多颗时，树的节点展开就有问题了，树是生成了没错，但是点击展开会触发其他某棵树的展开动作。**\r\n\r\n后来只有改用id方式获取ztree节点，如下：\r\n\r\n```\r\nvar $modal =$('#modal');\r\nvar ztreeId = $modal.find('.ztree-multiselect .selections').get(0).id;\r\n$.fn.zTree.init($('#' + ztreeId), setting, data);\r\n```"}}