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

Get Resource Parent ID

Asked by siddharthgupta2010@gmail.com
7 years ago.

Hi,

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'.

Thanks,
Siddharth

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

You can do it like this:

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

See also:
https://api.daypilot.org/daypilot-scheduler-rows-find/
https://api.daypilot.org/daypilot-row-parent/

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