Categories | Question details Back To List | ||
how to get the list of node parent parent until the final parent (root) is reached? how to get the list of node parent parent ..... root until the final parent (root) is reached? i.e. node, nodeparent, nodeparentparent,.....root Is there any method like getPreProcessingNodes() or postProcessingNOdes() I have tried this way.......need help regarding var parentids; function getListOfParentIds(id,accesslevelids) { var parentid=tree.getParentId(id); accesslevelids=parentid+","+accesslevelids; if(parentid!="0") getListOfParentIds(parentid,accesslevelids); else parentids=accesslevelids; //return ""+accesslevelids; } Actually when i try to return value in else part , it is giving undefined (since the loop is not yet finished, when the result has come) So, i have taken it in a separate variable "accesslevel". I need the function itself returning the result, ratherthan taken separately ina variable. Answer posted by Alex (support) on Aug 27, 2009 08:00 Try the following approach: function getParents(id){ |