Print widget: how to get selected layout and format

258
2
11-05-2021 04:08 AM
nadmoat
New Contributor

Hello, 

is there any way to get selected layout and format when the user change selection in the dropdown menues ?

Thanks,

Nadia

0 Kudos
2 Replies
Noah-Sager
Esri Regular Contributor

Hi @nadmoat, thanks for the question. What are you trying to accomplish?

If you open the developer tools of your browser and look at the network traffic, you can see the Format and Layout_Template in the request:

Screen Shot 2021-11-05 at 9.57.19 AM.png

You could also listen for an event when the printing is fired off and discover the Layout and Format that way:

https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print.html#events-summary

 

0 Kudos
MichaelBoschert
New Contributor III

Hey @nadmoat ,

you can get the templateOptions using the watchUtils.

        watchUtils.watch(print.templateOptions,"layout", (event)=>{
                console.log(event)
          });

 

0 Kudos