[Feature-2692]Perspective Table - How to deselect rows (with props.selection.mode = multiple interval)?

I can successfully select multiple rows by Shift + Mouse Click or Ctrl + Mouse Click but I can’t figure out how to deselect a row I’ve selected.

Thanks for reading!

1 Like

I’m having the same problem. The perspective table follows the same Shift-Click and Ctrl-Click conventions that are used elsewhere except Ctrl-Click on a selected row doesn’t deselect it.

This seems to be a bug in the Perspective table.

In my case I’m looking for a way to remove the existing selection, but once I select anything in the table there’s no way to remove the selection. I can change the selection, but I can’t remove it. Always there’s at least one row selected.

The only way I found to clear the selection completely was to set the table’s selection.selectedRow property to null (or None in script). But that requires some separate way to change that property, such as a button press.

1 Like

Just tested this in Ignition 8.1.0. The problem is still present.

3 Likes

I have tried in 8.1.4. The problem is still present.

I have tried in 8.1.5. The problem is still present.

Here is a work around:

  1. Add a custom property to your table named lastNewSelection and set it to null.
  2. Add an onRowClick script action and use this code:
	if event.row == self.custom.lastNewSelection:
		self.props.selection.selectedRow = None
		self.custom.lastNewSelection = None
	else:
		self.custom.lastNewSelection = event.row

It works by checking the previously selected row for the one that was just selected. If they match, it nulls the table’s .props.selection.selectedRow value. Otherwise, it lets the user proceed to select a new row as expected.