Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

213
Visualizações
Problem to present tree with treant js into symfony, in case of tree structure is an array of object

I want to create a tree with treant.js the structure form is like this:

var tree_structure=[ {container: '#OrganiseChart8', levelSeparation: 70, siblingSeparation: 60, nodeAlign: 'BOTTOM', connectors:  {
                type: "step",
                style: {
                    "stroke-width": 2,
                    "stroke": "#ccc",
                    "stroke-dasharray": "--", 
                }
},
 {innerHTML: '#first-post'},
 {parent: {innerHTML: '#first-post'}, innerHTML: '#1-reply'},
{parent: {innerHTML: '#first-post'}, innerHTML: '#2-reply'}
}];
new Treant(tree_structure);

displaying this code gives me a single node, which is the result of ({innerHTML: '#first-post'}) in case when I make each code of node in a variable , everything is going well, like this:

var first= {innerHTML: '#first-post'},
child1 ={ parent: first,  innerHTML: '#1-reply'},
child2 ={ parent: first,  innerHTML: '#2-reply'};
var tree_structure=[first,child1,child2];
new Treant(tree_structure);

The result gives me a display of three nodes. remarque: in my case, the tree dynamic (nodes processed via a database) and recursive, mince , I have much of node , the parent of child1_1 is child1

{parent:  {parent: {innerHTML: '#first-post'}, innerHTML: '#1-reply'}, innerHTML: '#1-reply-1'}

Thanks in advance.

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda