Posted 30 April 2020, 1:28 am EST
Hi Richard,
In the selectionChanged event of the FlexGrid, you can iterate over the rows above the currently selected row and if the level of the above row is less than the current row, then it is the parent:
this.familyGrid.selectionChanged.addHandler((s, e) => {
var item = s.rows[e.row].dataItem;
var chains = [item];
var lvl = s.rows[e.row].level;
for(let i = e.row - 1; i >= 0; i--) {
var curRow = s.rows[i];
if(curRow.level < lvl) {
var curItem = curRow.dataItem;
chains.splice(0, 0, curItem);
lvl = curRow.level;
}
}
console.log(chains);
});
Also, if the case of Billy, the chain will be Benjamin → Bridget → Billy.
Regards,
Ashwin