I have a TreeGrid with certain items duplicated under several different parent records. The action to take for a given item will depend partly on the parent of the item. However, I can't seem to figure out how, given a selected record, to find its parent. So, given:
How do I find the parent of selectedRecord? I could use MyTree.getRecord(id) but that method seems to be looking for a zero-based index of the parent record. How do I get that index? I can get the ParentID field of selectedRecord but I can't figure out how to use it to find the parent record since the ParentID foreign key doesn't necessarily match the zero-based record indices.
Code:
var selectedRecord=MyTree.selection.getSelection()[0];
Comment