This code i used onItemClickon menutree component .. I would like to generate the path to style dynamically based on the length of path list and index of the list
def runAction(self, event):
path_string = 'self.props'
for index in event.path:
path_string += '.items[{}]'.format(index)
path_string += '.style.classes'
#event.path =[1,0,1]
#path_string self.props.items[1].items[0].items[1].style.classes = 'mynewClass'
def runAction(self, event):
if event.path:
target = self.props
for index in event.path:
target = target.items[index]
target.style.classes = 'mynewClass'