# Open a window with Tree View

**URL:** <https://forum.inductiveautomation.com/t/open-a-window-with-tree-view/33742>\
**Category:** Ignition\
**Created:** [April 7, 2020, 12:55pm UTC](https://forum.inductiveautomation.com/t/open-a-window-with-tree-view/33742 "2020-04-07T12:55:31Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![lachguerabdallah](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lachguerabdallah/32/25558_2.png) [@lachguerabdallah](https://forum.inductiveautomation.com/u/lachguerabdallah)\
**Post date:** [April 7, 2020, 12:55pm UTC](https://forum.inductiveautomation.com/t/open-a-window-with-tree-view/33742/1 "2020-04-07T12:55:31Z")

</div>

Hello  
Is there a way that allows me to click on the path and access a window?  
for example, in the following screenshot, I want when I click on ‘barx’ to open a window.  
I have tried but without success.

 ![01](https://us1.discourse-cdn.com/inductiveautomation/original/2X/0/0c9c0005b6ef241992587bd13e3e516e23afd93b.png)

---

<div class="post-metadata">

**Author:** ![MaGottschalk](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@MaGottschalk](https://forum.inductiveautomation.com/u/MaGottschalk)\
**Post date:** [April 9, 2020, 12:11pm UTC](https://forum.inductiveautomation.com/t/open-a-window-with-tree-view/33742/2 "2020-04-09T12:11:42Z")

</div>

Hi,

When populating your Tree View you could add a column “window” to the dataset where you store the wanted window for each element. Then you add a mouseClicked event in your Tree Vew like that:

```auto
if event.clickCount == 2:	#react to double clicks only
	if event.source.selectedItem > -1:
		system.nav.swapTo(event.source.data.getValueAt(event.source.selectedItem, "window"))

```

---

<div class="post-metadata">

**Author:** ![lachguerabdallah](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lachguerabdallah/32/25558_2.png) [@lachguerabdallah](https://forum.inductiveautomation.com/u/lachguerabdallah)\
**Post date:** [April 9, 2020, 3:59pm UTC](https://forum.inductiveautomation.com/t/open-a-window-with-tree-view/33742/3 "2020-04-09T15:59:02Z")

</div>

Thanks for your reply.  
but what I want to do is put a path in the root folder. In the screenshot I attached, I want the ‘barx’ folder to have a window path too

---

<div class="post-metadata">

**Author:** ![MaGottschalk](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@MaGottschalk](https://forum.inductiveautomation.com/u/MaGottschalk)\
**Post date:** [April 10, 2020, 12:58pm UTC](https://forum.inductiveautomation.com/t/open-a-window-with-tree-view/33742/4 "2020-04-10T12:58:49Z")

</div>

Instead of

```auto
if event.source.selectedItem > -1:

```

you can check for

```auto
if event.source.selectedPath:

```

This gives you the path also for your folders. The windows to navigate to could be stored in a dataset memory tag.

---

<div class="post-metadata">

**Author:** ![lachguerabdallah](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lachguerabdallah/32/25558_2.png) [@lachguerabdallah](https://forum.inductiveautomation.com/u/lachguerabdallah)\
**Post date:** [April 12, 2020, 1:06am UTC](https://forum.inductiveautomation.com/t/open-a-window-with-tree-view/33742/5 "2020-04-12T01:06:17Z")

</div>

thanks you. resolved.
