how to traverse a wijmo tree
I was wondering if anyone has ever worked with wijmo compo开发者_开发知识库nents? What i am trying to do is to start from the root element of a wijmo tree, and traverse all the elements and return them as a tree structure.
thank you, krizD
The best way to do it would be to traverse the DOM using a recursive function on the li tags. Then turn it into JSON as a "tree object".
You can get the root level elements to begin your recursive function like so:
$("#tree").wijtree();
$("#tree > ul > li").each(function(){ yourRecursiveFunc(node) });
精彩评论