You are using popup in your snippet. This is a valid use-case, but popups can’t have automatic sub-popups. You can implement sub-popups by some custom code, but there is a more simple way - native menu and submenu component
When working with menu and submenu you can’t use layouts and custom views. Instead of that you can use template to define how menu item must look and behave.
That’s almost what I need, however, I also need to be able to disable/enable some of the options depending on other variables. Using the iconbuttons I was able to do this, but I’m not sure using templates allows me to disable specific items.
I could implement a check in the click handler to see if the action is allowed or not, but is there a better way?