Add a "beforeClose" event handler to a popup

For those of you wondering how to add an event handler to a skuid popup for any event (i.e. “close”, “beforeClose”, etc) here’s a simple line of code you can run once the popup opens.

skuid.$(".ui-dialog-content").dialog({<br>"beforeClose" : function()<br> {<br> //put your event-handler code here.<br> console.log(arguments);<br> }<br>})

Thanks Mordechai - appreciate you contributing to the Skuid Body of Knowledge… 

Is this possible to use for a drawer as well to run actions before the drawer closes?