How to 'unselect' the selected item in a sidebar?

Is there a way to remove a selection from a sidebar? That is, after having clicked upon one of the items, and it is allowed to be selected and thus highlighted, how can I later remove this selection?

I have actions to take when a user makes a selection. The “onSelect” event does not fire a second time if the user clicks the same item again. So I’m using the onBeforeSelect event to fire my actions that are really for a selection event, but by using the onBeforeSelect event I can see repeated user actions by denying the completion of the selection action (return false from the onBeforeSelect event).

I’d prefer a more straight forward method if there is one. Thanks.

You can use code like next


Thank you.