search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

Get Resource Parent ID

Asked by
4 years ago.


I have created a schedule page with resources tree like structure(Parent Child). Like:

dp.resources = [
{ name: "Locations", id: "G1", expanded: true, children:[
{ name : "Room 1", id : "A" },
{ name : "Room 2", id : "B" },
{ name : "Room 3", id : "C" },
{ name : "Room 4", id : "D" }


I want to get Parent of resource dynamically. Like If I pass resource id 'A' then it should return parent id that should be 'G1'.


Answer posted by Dan Letecky [DayPilot]
4 years ago.

You can do it like this:

var parentId = dp.rows.find("A").parent().id;

See also:

This question is more than 3 months old and has been closed. Please create a new question if you have anything to add.