Perspective Tree

Hi All,

I stuck with the same component. Iā€™m done level 1 but have problem with level 2.

My table:
image

	
	Level_1 = []
	items = []
	for job in value:
	    if job['id'] not in Level_1:
	        item = {
	            "label":{
	            "text": job['Level_1']},
	            "expanded": True,
	            "data": "",
	            "items": [
	                {
	                    "label": {
	                    "text": job['Level_2']},
	                    "expanded": False,
	                    ###############################################
	                    "data": {
	                        "jobID": job['id'],
	                        "Level_2": job['Level_2']
	                    },
	                    ###############################################
	                    "items": []
	                }
	            ]
	        }
	        Level_1.append(job['id_Level_2'])
	        items.append(item)
	    else:
	        for index, customer in enumerate(Level_1):
	            if customer == job['id_Level_2']:
	                itemIndex = index
	
	        item = {
	            "label": {
	            "text" : job['Level_2']
	            },
	            "expanded": False,
	            ###############################################
	            "data": {
	                "jobID": job['id'],
	                "Level_2": job['Level_2']
	            },
	            ###############################################
	            "items": []
	        }
	        items[itemIndex]['items'].append(item)
	
	
	return items

Results:
I can see all 4 from Level_1, but then Level_2 is not linked to Level_1.
I can see:
Defect - > Missing Lub
Materials ā†’ Screw cross treaded
Maintenance ā†’ 2E23458G01
Quality ā†’ 3E45658G02

I like to see:
Defects ā†’ Missing Lub
ā†’ Screw cross treaded
Materials ā†’ 2E23458G01
ā†’ 3E45658G02
Maintenance - > Empty
Quality ā†’ Empty

Best regards
Pawel