I am using esri/dijit/Popup in my javascript api 3.16 web application to return information about various layers. I have an image service identify task tied to the map click that returns an elevation and displays it in a div in the corner of the map. I would like to be able to hide the elevation div when I close the popup window, however I don't know what to listen for when I click the close button since there is no "id" associated with it. I've looked at the api reference for the popup class and I have tried using the code snippet - connect.connect(popup,"onHide",function(){ console.log('info window is hidden'); }); I've tried using '"on" instead of "connect" but nothing works. I saw someone had posted a similar question and received an answer however that solution works only in the new javascript api 4.0. Can anyone help me?
Thanks!
Solved! Go to Solution.
It would be really helpful, if you could share some code. If you are using default popup, below code works.
map.infoWindow.on('hide', function(){ alert("infoWindow hide event"); })
If you have created you own popup, then you should use that instance to listen to "hide" event
It would be really helpful, if you could share some code. If you are using default popup, below code works.
map.infoWindow.on('hide', function(){ alert("infoWindow hide event"); })
If you have created you own popup, then you should use that instance to listen to "hide" event
That is it! Thank you so much. I spent far too long trying to figure that out!