Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

208
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!