vendredi 29 mai 2015

javascript tree - recursion

var arr= [{id: "1", state: "1", ndi: "1558.3045298", children: "null"},
          {id: "2", state: "1", ndi: "1684.0732025", children: "null"},
          {id: "3", state: "1", ndi: "1809.8418752", children: "null"},
          {id: "4", state: "2", ndi: "1915.1603572", children: "null"},
          {id: "5", state: "2", ndi: "2023.5463678", children: "null"}]

How to create a tree recursively with above data keeping state as the root element

Aucun commentaire:

Enregistrer un commentaire