How to disable the multiple selection in Perspective Tree component?

Hello Everyone,
I am using the tree view component in ignition perspective 8.1. Where i need to disable the multiple selection of tags. Can anyone suggest how to fix this issue.
Concern is instead of multiple selection need to allow single selection.
PFA,

There doesn't seem to be an option.

It looks as though the last item clicked is at the bottom of the list so you could add a script to the onItemClicked event to delete all the props.selection and props.selectionData entries except for the last. (You would need to handle deselecting all items too.)

See if there are any clues in Tree in perspective, multiselect label.

2 Likes

place this in the onItemClicked script:

def runAction(self, event):
	itemPath = '/'.join([str(_) for _ in event.itemPath])
	self.props.selection = [itemPath]
	if len(self.props.selectionData) > 0:
		self.props.selectionData = [self.props.selectionData[-1]]

Edit: Updated to keep selectionData synchronized. Note that this script does not manage de-selection of items.

4 Likes

Thanks for your response.
But now it is happening in same way when I select multiple tags it selects the last one. My concern is not allow for multiple selection. If user tries to press ctrl key and selects too it should not allow.
As in our vision We have an option called "Single / Multiple " Selection. Do we have such kind of property in Perspective.

No, not for that component.