you can also subscribe to the event with the existing function
myControl.addEventListener("onclose", oncloseEventHandler) function oncloseEventHandler(event) { //do stuff }