{"action":"created","issue":{"url":"https://api.github.com/repos/mbraak/jqTree/issues/418","repository_url":"https://api.github.com/repos/mbraak/jqTree","labels_url":"https://api.github.com/repos/mbraak/jqTree/issues/418/labels{/name}","comments_url":"https://api.github.com/repos/mbraak/jqTree/issues/418/comments","events_url":"https://api.github.com/repos/mbraak/jqTree/issues/418/events","html_url":"https://github.com/mbraak/jqTree/issues/418","id":153404315,"number":418,"title":"get Main Parent Node","user":{"login":"urprasu","id":3919425,"avatar_url":"https://avatars.githubusercontent.com/u/3919425?v=3","gravatar_id":"","url":"https://api.github.com/users/urprasu","html_url":"https://github.com/urprasu","followers_url":"https://api.github.com/users/urprasu/followers","following_url":"https://api.github.com/users/urprasu/following{/other_user}","gists_url":"https://api.github.com/users/urprasu/gists{/gist_id}","starred_url":"https://api.github.com/users/urprasu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/urprasu/subscriptions","organizations_url":"https://api.github.com/users/urprasu/orgs","repos_url":"https://api.github.com/users/urprasu/repos","events_url":"https://api.github.com/users/urprasu/events{/privacy}","received_events_url":"https://api.github.com/users/urprasu/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-05-06T08:35:52Z","updated_at":"2016-05-06T10:32:18Z","closed_at":null,"body":"Hi , \r\n\r\nI want to find the parent node recursively.\r\n\r\nFor example node id = 10 have parents node id 7 and node id 4.\r\n\r\nSO i want to find the main parent node.\r\n\r\nIf give node id is 10 then main parent node id 4. (I want result like this)\r\n\r\nCan you help us above issue.\r\n\r\nvar data = [{\r\n\t\"id\": \"1\",\r\n\t\"name\": \"Root node\",\r\n\t\"children\": [{\r\n\t\t\"id\": \"2\",\r\n\t\t\"name\": \"Child node 1\"\r\n\t}, {\r\n\t\t\"id\": \"3\",\r\n\t\t\"name\": \"Child node 2\"\r\n\t}, {\r\n\t\t\"id\": \"4\",\r\n\t\t\"name\": \"Child node 3\",\r\n        \"children\": [{\r\n            \"id\": \"7\",\r\n            \"name\": \"Child child 1\",\r\n            \"children\": [{\r\n                \"id\": \"9\",\r\n                \"name\": \"Child child child 1\"\r\n            }, {\r\n                \"id\": \"10\",\r\n                \"name\": \"Child child child 2\"\r\n            }]\r\n        }, {\r\n            \"id\": \"8\",\r\n            \"name\": \"Child child 2\"\r\n        }]\r\n\t}, {\r\n\t\t\"id\": \"5\",\r\n\t\t\"name\": \"Child node 4\"\r\n\t}, {\r\n\t\t\"id\": \"6\",\r\n\t\t\"name\": \"Child node 5\"\r\n\t}]\r\n}];"},"comment":{"url":"https://api.github.com/repos/mbraak/jqTree/issues/comments/217407228","html_url":"https://github.com/mbraak/jqTree/issues/418#issuecomment-217407228","issue_url":"https://api.github.com/repos/mbraak/jqTree/issues/418","id":217407228,"user":{"login":"urprasu","id":3919425,"avatar_url":"https://avatars.githubusercontent.com/u/3919425?v=3","gravatar_id":"","url":"https://api.github.com/users/urprasu","html_url":"https://github.com/urprasu","followers_url":"https://api.github.com/users/urprasu/followers","following_url":"https://api.github.com/users/urprasu/following{/other_user}","gists_url":"https://api.github.com/users/urprasu/gists{/gist_id}","starred_url":"https://api.github.com/users/urprasu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/urprasu/subscriptions","organizations_url":"https://api.github.com/users/urprasu/orgs","repos_url":"https://api.github.com/users/urprasu/repos","events_url":"https://api.github.com/users/urprasu/events{/privacy}","received_events_url":"https://api.github.com/users/urprasu/received_events","type":"User","site_admin":false},"created_at":"2016-05-06T10:32:18Z","updated_at":"2016-05-06T10:32:18Z","body":"i want to get all the parent nodes of a child node"}}