Mohsin Arif

Mohsin Arif

  • 312
  • 6k
  • 138.1k

Making a Tree like Structure in Json With Recursion

Mar 3 2020 4:48 AM

I'm struggling to get my head around this one, i've had a few attempts and failed miserably.

Basically I have a list of Employees in a database, each with an ID. A Employee can have a parent Employee (Refer as Manager).

I need to output the structure in some sort of tree in json format like shown in this URL

https://raw.githubusercontent.com/bumbeishvili/Assets/master/Projects/D3/Organization%20Chart/redesignedChartLongData.json

Here is a very basic structure example.

 

Answers (1)