findParent<T extends TreeData> static method
Implementation
static bool findParent<T extends TreeData>(List<TreeVO<T>> list, TreeVO<T> treeVO) {
for (TreeVO<T> v in list) {
if (v.data!.id == treeVO.data!.pid) {
v.children.add(treeVO);
treeVO.parent = v;
return true;
}
if (v.children.length > 0) {
if (findParent(v.children, treeVO)) {
return true;
}
}
}
return false;
}