{"action":"created","issue":{"url":"https://api.github.com/repos/jonmiles/bootstrap-treeview/issues/240","repository_url":"https://api.github.com/repos/jonmiles/bootstrap-treeview","labels_url":"https://api.github.com/repos/jonmiles/bootstrap-treeview/issues/240/labels{/name}","comments_url":"https://api.github.com/repos/jonmiles/bootstrap-treeview/issues/240/comments","events_url":"https://api.github.com/repos/jonmiles/bootstrap-treeview/issues/240/events","html_url":"https://github.com/jonmiles/bootstrap-treeview/issues/240","id":161126785,"number":240,"title":"Get all parent data from selected nodeId","user":{"login":"pajarft","id":7865855,"avatar_url":"https://avatars.githubusercontent.com/u/7865855?v=3","gravatar_id":"","url":"https://api.github.com/users/pajarft","html_url":"https://github.com/pajarft","followers_url":"https://api.github.com/users/pajarft/followers","following_url":"https://api.github.com/users/pajarft/following{/other_user}","gists_url":"https://api.github.com/users/pajarft/gists{/gist_id}","starred_url":"https://api.github.com/users/pajarft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pajarft/subscriptions","organizations_url":"https://api.github.com/users/pajarft/orgs","repos_url":"https://api.github.com/users/pajarft/repos","events_url":"https://api.github.com/users/pajarft/events{/privacy}","received_events_url":"https://api.github.com/users/pajarft/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/jonmiles/bootstrap-treeview/labels/question","name":"question","color":"cc317c"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-06-20T06:43:43Z","updated_at":"2016-07-24T19:48:53Z","closed_at":null,"body":"Hello,\r\n\r\nis there any way to get all parent data from selected nodeId\r\n![capture](https://cloud.githubusercontent.com/assets/7865855/16185249/6190496c-36fd-11e6-83c2-3557862d3cc3.PNG)\r\ni want to get **Building 1** and **FLOOR 1** data\r\nany idea?\r\n\r\nThanks in advance and have a nice day."},"comment":{"url":"https://api.github.com/repos/jonmiles/bootstrap-treeview/issues/comments/234798012","html_url":"https://github.com/jonmiles/bootstrap-treeview/issues/240#issuecomment-234798012","issue_url":"https://api.github.com/repos/jonmiles/bootstrap-treeview/issues/240","id":234798012,"user":{"login":"jkshay","id":3605231,"avatar_url":"https://avatars.githubusercontent.com/u/3605231?v=3","gravatar_id":"","url":"https://api.github.com/users/jkshay","html_url":"https://github.com/jkshay","followers_url":"https://api.github.com/users/jkshay/followers","following_url":"https://api.github.com/users/jkshay/following{/other_user}","gists_url":"https://api.github.com/users/jkshay/gists{/gist_id}","starred_url":"https://api.github.com/users/jkshay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jkshay/subscriptions","organizations_url":"https://api.github.com/users/jkshay/orgs","repos_url":"https://api.github.com/users/jkshay/repos","events_url":"https://api.github.com/users/jkshay/events{/privacy}","received_events_url":"https://api.github.com/users/jkshay/received_events","type":"User","site_admin":false},"created_at":"2016-07-24T19:48:53Z","updated_at":"2016-07-24T19:48:53Z","body":"Here's my recursive implementation (written for the development branch, so it uses getParents). Given a node, it returns an array of nodes from the provided node up the parental tree to root:\r\n\r\n`    // given a node, provides an array of that nodes ancestors\r\n    function getAncestors(node, ancestors) {\r\n\r\n        // Create ancestors array if not provided\r\n        if (ancestors === undefined) {\r\n            ancestors = new Array();\r\n        }\r\n\r\n        // Add the provided node to the array\r\n        if (node !== null && node !== undefined) {\r\n            ancestors.push(node);\r\n        }\r\n\r\n        // Get the node's parent\r\n        var parent = $(_selector).treeview('getParents', node);\r\n\r\n        // A parent exists; recursively add ancestors\r\n        if (parent.length > 0) {\r\n            getAncestors(parent[0], ancestors);\r\n        }\r\n\r\n        return ancestors;\r\n    }`"}}
{"actor":{"display_login":"jkshay"}}