Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Wijmo コンポーネントを使用したことがある人はいますか? 私がやろうとしているのは、wijmo ツリーのルート要素から開始し、すべての要素をトラバースしてツリー構造として返すことです。
ありがとう、krizD
これを行う最善の方法は、li タグで再帰関数を使用して DOM をトラバースすることです。次に、「ツリー オブジェクト」として JSON に変換します。
ルート レベルの要素を取得して、次のように再帰関数を開始できます。
$("#tree").wijtree(); $("#tree > ul > li").each(function(){ yourRecursiveFunc(node) });