FlexGrid has two types of rows: regular rows (Row objects) and nodes (GroupRow objects). Regular rows do not have a "level", while GroupRow objects possess a "level" property that indicates the node's level.
If you need to find a row's parent node, you can iterate through the grid's rows collection until you locate a node with a "level" lower than the starting point.
Take a look at this example:
http://jsfiddle.net/Wijmo5/8n2yde6f/
Pay attention to the implementation of the "getParentNode" function, which should help you achieve your objective:
// Retrieve the parent row for a given FlexGrid row.
// Return the parent row or null if the original row has no parent.
function getParentNode(row) {
// Get the row's level
var startLevel = row instanceof(wijmo.grid.GroupRow) ? row.level : -1;
var startIndex = row.index;
// Traverse upwards to find the parent node
for (var i = startIndex - 1; i >= 0; i--) {
var thisRow = row.grid.rows[i],
thisLevel = thisRow instanceof(wijmo.grid.GroupRow) ? thisRow.level : -1;
if (thisLevel > -1) {
if (startLevel == -1 || (startLevel > -1 && thisLevel < startLevel)) {
return thisRow;
}
}
}
// If not found
return null;
};
I hope you find this information helpful.