# Tree view order nodes before leaves

**URL:** <https://forum.inductiveautomation.com/t/tree-view-order-nodes-before-leaves/26655>\
**Category:** Ignition\
**Tags:** ignition80, vision\
**Created:** [July 18, 2019, 9:17am UTC](https://forum.inductiveautomation.com/t/tree-view-order-nodes-before-leaves/26655 "2019-07-18T09:17:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![joel.golinucci](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/joel.golinucci/32/9927_2.png) [@joel.golinucci](https://forum.inductiveautomation.com/u/joel.golinucci)\
**Post date:** [July 18, 2019, 9:17am UTC](https://forum.inductiveautomation.com/t/tree-view-order-nodes-before-leaves/26655/1 "2019-07-18T09:17:54Z")

</div>

Hi,

I want to use a tree view as a navigation system, and my windows are arranged for some in sub folders and for others directly on the root node  
The issue is that, even though the Auto Sort is Flase, the nodes (folders) are always shown above the leaves

I can change the display order of the folders or of the leaves, but I cannot move a leaf above a folder.

![image](https://us1.discourse-cdn.com/inductiveautomation/original/2X/b/bb113e57a7b3f94f7aa4e51608fa824daa5467d6.png)

Code of the create menu function, (custom method of the tree view):

```auto
	headers = ["path","text","icon","background","foreground","tooltip","border","selectedText","selectedIcon","selectedBackground","selectedForeground","selectedTooltip","selectedBorder"]

	rows = []
	
	
	home = [u"", u"Accueil", "Builtin/icons/16/home.png", "color(255,255,255,255)", "color(46,46,46,255)", u"Page d'accueil", "", "", "Builtin/icons/16/home.png", "color(71,169,230,255)", "color(255,255,255,255)", "", ""]
	rows.append(home)

	administration = [u"", u"Administration", "Builtin/icons/16/lock.png", "color(255,255,255,255)", "color(46,46,46,255)", u"Administration", "", "", "Builtin/icons/16/lock_open.png", "color(71,169,230,255)", "color(255,255,255,255)", "", ""]
	rows.append(administration)

	astreinte = [u"Administration", u"Astreinte", "Builtin/icons/16/businessmen.png", "color(255,255,255,255)", "color(46,46,46,255)", u"Gestion des groupes d'astreinte" , "", "", "Builtin/icons/16/businessmen.png", "color(71,169,230,255)", "color(255,255,255,255)", "", ""]
	rows.append(astreinte)		
		
	gestionPostes = [u"Administration", u"Postes", "Builtin/icons/16/workstation1.png", "color(255,255,255,255)", "color(46,46,46,255)", u"Gestion des postes", "", "", "Builtin/icons/16/workstation1.png", "color(71,169,230,255)", "color(255,255,255,255)", "", ""]
	rows.append(gestionPostes)	
		
	gestionSignaux = [u"Administration", u"Signaux", "Builtin/icons/16/oszillograph.png", "color(255,255,255,255)", "color(46,46,46,255)", u"Gestion des signaux", "", "", "Builtin/icons/16/oszillograph.png", "color(71,169,230,255)", "color(255,255,255,255)", "", ""]
	rows.append(gestionSignaux)			

[...]

	self.data = system.dataset.toDataSet(headers, rows)

```

---

<div class="post-metadata">

**Author:** ![manjuyadav95.m](https://avatars.discourse-cdn.com/v4/letter/m/9fc348/32.png) [@manjuyadav95.m](https://forum.inductiveautomation.com/u/manjuyadav95.m)\
**Post date:** [September 21, 2022, 5:51am UTC](https://forum.inductiveautomation.com/t/tree-view-order-nodes-before-leaves/26655/2 "2022-09-21T05:51:36Z")

</div>

plz let me know if solved this issue

---

<div class="post-metadata">

**Author:** ![patrick.maltais](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/patrick.maltais/32/3958_2.png) [@patrick.maltais](https://forum.inductiveautomation.com/u/patrick.maltais)\
**Post date:** [October 27, 2023, 7:22pm UTC](https://forum.inductiveautomation.com/t/tree-view-order-nodes-before-leaves/26655/3 "2023-10-27T19:22:05Z")

</div>

I was able to achieve roughly the same by using two separate controls. The top one lists the nodes without children/folders. The bottom one lists folders. I suppose it's possible adjust the controls height in some way depending on the number of nodes it has to display.  
Hope it helps!  
 ![Capture](https://us1.discourse-cdn.com/inductiveautomation/original/3X/d/d/dd2ac37a514bd1325bc66da91233e4b88d80f0f8.png)
