Popup actions - Capture Close Event

1680
2
Jump to solution
06-18-2020 12:22 PM
AndrewMurdoch1
Occasional Contributor II

Hey

Is there anyway to capture the close event on the Popup?  It's great I can easily launch the Popup, but I want to know when the user closes it.   Specifically this close button:

Thanks

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Esteemed Contributor

Andrew,

   In 3.x you look for the popups hide event

https://developers.arcgis.com/javascript/3/jsapi/popup-amd.html#event-hide 

In 4.x

        watchUtils.whenTrue(view.popup,'visible', function(){
          watchUtils.whenFalseOnce(view.popup,'visible', function(){
            console.info('popup has been closed');
          })
        });

View solution in original post

2 Replies
RobertScheitlin__GISP
MVP Esteemed Contributor

Andrew,

   In 3.x you look for the popups hide event

https://developers.arcgis.com/javascript/3/jsapi/popup-amd.html#event-hide 

In 4.x

        watchUtils.whenTrue(view.popup,'visible', function(){
          watchUtils.whenFalseOnce(view.popup,'visible', function(){
            console.info('popup has been closed');
          })
        });
AndrewMurdoch1
Occasional Contributor II

Thanks! That's exactly what I was looking for

0 Kudos