# Previous page in horizontal/menu tree

**URL:** <https://forum.inductiveautomation.com/t/previous-page-in-horizontal-menu-tree/109390>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [August 5, 2025, 3:28pm UTC](https://forum.inductiveautomation.com/t/previous-page-in-horizontal-menu-tree/109390 "2025-08-05T15:28:54Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![derek.stoddard](https://avatars.discourse-cdn.com/v4/letter/d/7993a0/32.png) [@derek.stoddard](https://forum.inductiveautomation.com/u/derek.stoddard)\
**Post date:** [August 5, 2025, 3:28pm UTC](https://forum.inductiveautomation.com/t/previous-page-in-horizontal-menu-tree/109390/1 "2025-08-05T15:28:54Z")

</div>

Hello everyone,  
I'm pretty new to Perspective and am designing navigation menus for my project. I was going to use a horizontal menu for the desktop views and a menu tree for mobile views. Is there a way to script a "previous page" function into these components?  
Thanks!

---

<div class="post-metadata">

**Author:** ![ryan.white](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ryan.white/32/73193_2.png) [@ryan.white](https://forum.inductiveautomation.com/u/ryan.white)\
**Post date:** [August 5, 2025, 3:44pm UTC](https://forum.inductiveautomation.com/t/previous-page-in-horizontal-menu-tree/109390/2 "2025-08-05T15:44:16Z")

</div>

Add a button or item yourself that calls [`system.perspective.navigateBack`](https://www.docs.inductiveautomation.com/docs/8.1/appendix/scripting-functions/system-perspective/system-perspective-navigateBack)?

On the tree you'll probably have to script on the `onItemClicked` event and filter to make sure it only fires for the 'back' item.

---

<div class="post-metadata">

**Author:** ![derek.stoddard](https://avatars.discourse-cdn.com/v4/letter/d/7993a0/32.png) [@derek.stoddard](https://forum.inductiveautomation.com/u/derek.stoddard)\
**Post date:** [August 5, 2025, 4:09pm UTC](https://forum.inductiveautomation.com/t/previous-page-in-horizontal-menu-tree/109390/3 "2025-08-05T16:09:24Z")

</div>

That's what I'm trying to do...I can't figure out a way to call [system.perspective.navigateBack](https://www.docs.inductiveautomation.com/docs/8.1/appendix/scripting-functions/system-perspective/system-perspective-navigateBack) into a menu item. I don't think a Change Script works and it doesn't seem as though there are other scripting options. Apologies if this is a silly question, like I said I'm still figuring Perspective out.

---

<div class="post-metadata">

**Author:** ![ryan.white](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ryan.white/32/73193_2.png) [@ryan.white](https://forum.inductiveautomation.com/u/ryan.white)\
**Post date:** [August 5, 2025, 4:13pm UTC](https://forum.inductiveautomation.com/t/previous-page-in-horizontal-menu-tree/109390/4 "2025-08-05T16:13:10Z")

</div>

In both the tree and horizontal menu, you would need to use the `onItemClicked` event handler in the event setup. You need to configure these on the component itself, NOT on the individual items in the component. Make sure the component is selected in the project browser tree, and right click on it, and select 'Configure Events'

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/a/6/a6196fff7f649393b7c1a7d33292334817ea0d76.png)

> **[Perspective - Horizontal Menu Scripting | Ignition User Manual](https://www.docs.inductiveautomation.com/docs/8.1/appendix/components/perspective-components/perspective-navigation-palette/perspective-horizontal-menu/perspective-horizontal-menu-scripting#component-events)**
>
> This page details the various scripting, component, and extension functions available for Perspective's Horizontal Menu component.

> **[Perspective - Menu Tree Scripting | Ignition User Manual](https://www.docs.inductiveautomation.com/docs/8.1/appendix/components/perspective-components/perspective-navigation-palette/perspective-menu-tree/perspective-menu-tree-scripting)**
>
> This page details the various scripting, component, and extension functions available for Perspective's Menu Tree component.

---

<div class="post-metadata">

**Author:** ![derek.stoddard](https://avatars.discourse-cdn.com/v4/letter/d/7993a0/32.png) [@derek.stoddard](https://forum.inductiveautomation.com/u/derek.stoddard)\
**Post date:** [August 5, 2025, 4:29pm UTC](https://forum.inductiveautomation.com/t/previous-page-in-horizontal-menu-tree/109390/5 "2025-08-05T16:29:36Z")

</div>

Ooohhhhh, thank you so much!
