{"action":"created","issue":{"url":"https://api.github.com/repos/mbraak/jqTree/issues/355","labels_url":"https://api.github.com/repos/mbraak/jqTree/issues/355/labels{/name}","comments_url":"https://api.github.com/repos/mbraak/jqTree/issues/355/comments","events_url":"https://api.github.com/repos/mbraak/jqTree/issues/355/events","html_url":"https://github.com/mbraak/jqTree/issues/355","id":58058218,"number":355,"title":"In case of Lazy Loading tree, Load some nodes initially and show particular node as a selected.","user":{"login":"sanjaysemilo","id":10881829,"avatar_url":"https://avatars.githubusercontent.com/u/10881829?v=3","gravatar_id":"","url":"https://api.github.com/users/sanjaysemilo","html_url":"https://github.com/sanjaysemilo","followers_url":"https://api.github.com/users/sanjaysemilo/followers","following_url":"https://api.github.com/users/sanjaysemilo/following{/other_user}","gists_url":"https://api.github.com/users/sanjaysemilo/gists{/gist_id}","starred_url":"https://api.github.com/users/sanjaysemilo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sanjaysemilo/subscriptions","organizations_url":"https://api.github.com/users/sanjaysemilo/orgs","repos_url":"https://api.github.com/users/sanjaysemilo/repos","events_url":"https://api.github.com/users/sanjaysemilo/events{/privacy}","received_events_url":"https://api.github.com/users/sanjaysemilo/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-02-18T11:49:34Z","updated_at":"2015-02-18T13:44:08Z","closed_at":null,"body":"I am calling GetType Method from Js as follows:\r\n\r\n$('#tree').tree({\r\n    dataUrl: '/api/GetType',\r\n    dragAndDrop: false,\r\n    useContextMenu: false \r\n});\r\n\r\nMy controller implementation is like this:\r\n\r\n       public IEnumerable<TypeTreeViewModel> Get()\r\n        {\r\n            return this.Get(null);\r\n        }\r\n\r\n        public IEnumerable<TypeTreeViewModel> Get(int? node)\r\n        {\r\n            var children = this.typeService.GetTypes(node);                \r\n\r\n            return children.Select(x =>\r\n                new TypeTreeViewModel\r\n                {\r\n                    Id = x.Id,\r\n                    Code =  x.Number ,\r\n                    Name = x.Name,                   \r\n                    LoadOnDemand = true,                  \r\n                });\r\n        }\r\n\r\nOn page load I want to show one child node as a selected.\r\n\r\nI dont on to load all other unrelated node. only parent nodes related to node which we want to select should be there.\r\n\r\nHow we will achive this using jqtree?"},"comment":{"url":"https://api.github.com/repos/mbraak/jqTree/issues/comments/74865339","html_url":"https://github.com/mbraak/jqTree/issues/355#issuecomment-74865339","issue_url":"https://api.github.com/repos/mbraak/jqTree/issues/355","id":74865339,"user":{"login":"sanjaysemilo","id":10881829,"avatar_url":"https://avatars.githubusercontent.com/u/10881829?v=3","gravatar_id":"","url":"https://api.github.com/users/sanjaysemilo","html_url":"https://github.com/sanjaysemilo","followers_url":"https://api.github.com/users/sanjaysemilo/followers","following_url":"https://api.github.com/users/sanjaysemilo/following{/other_user}","gists_url":"https://api.github.com/users/sanjaysemilo/gists{/gist_id}","starred_url":"https://api.github.com/users/sanjaysemilo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sanjaysemilo/subscriptions","organizations_url":"https://api.github.com/users/sanjaysemilo/orgs","repos_url":"https://api.github.com/users/sanjaysemilo/repos","events_url":"https://api.github.com/users/sanjaysemilo/events{/privacy}","received_events_url":"https://api.github.com/users/sanjaysemilo/received_events","type":"User","site_admin":false},"created_at":"2015-02-18T13:44:08Z","updated_at":"2015-02-18T13:44:08Z","body":"It is a c# code. This functions returns data in the json foramt as follow:\r\n[{\"id\":13,\"label\":\"D type\",\"code\":\"D\",\"load_on_demand\":true}, {\"id\":23,\"label\":\"M type\",\"code\":\"M \", \"load_on_demand\":true }]\r\n\r\nWe have view model for conversion as follow:\r\n\r\n[DataContract]\r\npublic class TypeTreeViewModel\r\n{\r\n[DataMember(Name = \"id\")]\r\npublic int Id { get; set; }\r\n\r\n    [DataMember(Name = \"label\")]\r\n    public string Name { get; set; }\r\n\r\n    [DataMember(Name = \"code\")]\r\n    public string Code { get; set; }     \r\n\r\n    [DataMember(Name = \"load_on_demand\")]\r\n    public bool LoadOnDemand { get; set; } \r\n}"}}