Menu Tree: How to Auto-Select & Expand Items Using a "source" Parameter?

Hi all,

I’m using a Perspective Menu Tree with nested items (example: Alarms → Alarm Overview / Alarm Rules, Settings → User Management / Asset Management).

My onItemClicked script works, but I also need the menu to update when a view parameter changes, like:

view.params.source = "Alarm Overview"

What I want

  • Highlight the correct menu item

  • Change icon color

  • Auto-expand its parent (Alarms, Settings, etc.)

  • Only one item selected at a time

  • Works for both root and submenu items

The issue

The source propertyChange script is not consistent:

  • submenu does not expand

My question

:backhand_index_pointing_right: What is the best way to programmatically select + highlight a Menu Tree item and expand its parent based on a parameter?
If anyone has a clean example script for this, it would help a lot.

Thanks in advance :slightly_smiling_face: !

You can use this to highlight selections on the menu tree.

If you want the menu tree to update when the view parameter changes, you need to implement the above functionality in a message handler and call the message handler on value change of the view parameter.

The message handler must be placed on the same menu tree component that you want to see the functionality on.