Hello, I wonder if should be possible to change the "actual" navigation of a menu tree in Perspective via script.
For example when I click a button I would like to open the menu tree in a sub-item view.
Hello, I wonder if should be possible to change the "actual" navigation of a menu tree in Perspective via script.
For example when I click a button I would like to open the menu tree in a sub-item view.
Leave the target
property blank on the instance you want to show a sub menu, and add instances to the items
property
The items
property is already create and by default it opens from the main menu, for example
Menu1
Menu2
Menu3
When I click a button I open the left docked of the menu tree navigation and I want to move in a subview, so I want to be here for example:
Menu1 - Sub1
Menu1 - Sub2
Menu1 - Sub3
Thanks for the help
Isn't that the default way that the menu tree component behaves?
As Ryan mentioned, you can just add instances to the items property to add more submenu items and set their respective targets to your views.
You must forgive me, but I don't think I was clear in my explanation.
The Menu Tree
is already fully structured, and there is no need for me to add new submenu items.
Let me give a practical example to clarify. When I launch the application in the browser from scratch, a map opens where I can select the area of the world I want to navigate.
The Menu Tree
has 4 initial items that correspond to 4 plants located in different parts of the world. When I click on the map, for example, in Asia, I would like to simulate the click on the Asia
item of the menu tree via script so that the user is already in the submenu of that plant.
I don't think the menu tree has any way for you to programmatically 'click' on one of it's items.
You'll have to configure the map component with svgs or icons for the different facilities, and then use system.perspective.navigate
in the onMarkerClick
or onVectorClick
actions on the map to navigate to your desired page.
I already do this type of work, and when I click on the map, I use system.perspective.navigate
as you rightly suggested to open the desired view.
What doesn't happen, of course, is that the tree menu remains at the main items. So, if a user clicks on the map, the correct view will open, but they will have to manually navigate into the submenu tree item Asia
.
I would like to automate this step via script because I find it absurd to create a quick way to open a facility if, when I go to the navigation tree menu, I find myself one step behind.
There is no native way to expand or collapse the menu items in the Menu Tree. The Java script which is used to do this is not exposed.
Probably a good feature request though, if it isn't already one.
I understand, the Java script is something I can find some manuals or examples? Because actually I don't know what exactly to search for.
Thank you
No. Java script itself you can find references to, and you might be able to dig around in the developer tools and find what they're doing, but without a third party module, you can not modify or add to the java script that is produced by the designer.
What you are trying to accomplish comes with a large amount of technical debt.
I understand, thanks for your time.
I'll wait for some future update, I guess this feature could be appreciate from all of us.