Menu tree ItemOnClick access item property

Hello,

I'm using menu tree component for navigation. There is a onItemClicked event but there is no reference to the clicked item. I want to read my custom property on the item.

There is only a list of indexes (event.path) but I'm not sure how to use that to get the Items property. Can someone explain it to me?

Thank you for help.

The cutom prop is on the actuall item not on the view.

I have solved it like this:

def runAction(self, event):
	item = self.props
	for i in event.path:
		item = item.items[i]
	
	system.perspective.print(item["customProp"])
	

Is there other (cleaner) way? Or it has to be done like this?

Sorry, I think you're going to have to show where on the component this customProp is. Post the JSON for the Menu Tree component and format it using the </> button.