0
I have this json [{"id":1,"id_pai":null,"id_usuario":1,"ordem":1,"lado":"1"},[{"id":2,"id_pai":1,"id_usuario":2,"ordem":1,"lado":"1"},{"id":3,"id_pai":1,"id_usuario":3,"ordem":2,"lado":"2"}],[{"id":4,"id_pai":2,"id_usuario":4,"ordem":1,"lado":"1"}],[{"id":2,"id_pai":1,"id_usuario":2,"ordem":1,"lado":"1"},{"id":3,"id_pai":1,"id_usuario":3,"ordem":2,"lado":"2"}]]
I need to go through and turn it into this, the missing data, I’ll add it later.
{ id: 0, parent: null, description: "Nivel do Peão", email: "[email protected]", groupTitleColor: "#4169e1", image: "demo/images/photos/q.png", itemTitleColor: "#4169e1", phone: "(19) 98111-9983", title: "Nome do Peão", label: "Nome do Peão" }
How do I navigate it with javascript?
Question 2, how do I not go through the duplicate items?
Isn’t it easier to modify your query that builds this data? Is your question about Jstree? https://answall.com/questions/43477/montar-%C3%A1rvore-jstree
– Marconi
Yes, in theory, the problem is that I am consuming this js of an api that returns me in the initial form, the second way, is which I need to leave to scroll in the data structure to run in the plugin I am using...
– Diego Ananias