Skip to main content

On Widget close

Triggered when the widget is closed or dismissed. This event helps clean up or finalize widget operations.

Commonly used for :
  • Clearing temporary session data
  • Stopping background listeners or timers
  • Restoring the widget to its initial condition for the next time it opens
  • Releasing allocated resources
  • Recording closure details for debugging or tracking purposes
Sample Code :
REQUEST DETAILS
window.onload = function () {
  ZFAPPS.extension.init().then(function(App) {
   App.instance.on('ON_WIDGET_CLOSE', function () {
   /* Actions */ 
   });
  })
};