Parameters:
selector.attachEvent("onBeforeChange", function (selectedObject,previousObject){ //any custom logic here return true; });
The event is blockable: if non-true value is returned from a custom method, the new item won't be selected.