Issue: Perspective table row remains highlighted after selectedRow property is set to None. Goal: Using script, deselect and un-highlight the row of a table component.
More info: I am attempting to deselect the row of the table component. I have successfully deselected the row using ...props.selection.selectedRow = None. Yet the row remains highlighted. Any suggestions to un-highlight the row would be greatly appreciated.
Note: The table that I am working with has two columns, but only one is shown.
I was able to find a work around. If the selectedRow and selectedColumn are set to -1, the row is unhighlighted. Then the selectedRow and selectedColumn can be set to None.
The most reliable way I've found to do this is to disable row selection, let that bounce over to the browser, which will then clear props.selection.data. A change event on props.selection.data can then re-enable row selection when it sees the new empty value.
In general, properties that are set via user interaction in the browser, like selections, need to also be unset by the browser. Unsetting them directly via script (which runs in the gateway, not the browser) is unreliable.
I've been using a library function I created for this purpose. I could be mistaken but I think @pturmel has indicated that Timers aren't totally reliable, but they've always seemed to work well for my purposes.
No need for a timer if you follow my pseudocode. And a timer doesn't ensure that the traffic made the round trip to the browser. (Do note that you should not blindly disable row selection--only do so when there is a non-empty selection that you wish to eliminate.)