Print Template Dijit - Just two options to print

767
4
01-23-2014 07:57 AM
ionarawilson1
Occasional Contributor III
Is it possible to change the print template dijit options, for example not to have so many options (delete a few) and also to change what they are called, for example, instead of "A4 Landscape" I would have only Landscape. I would like to have only two options: Landscape and Portrait and they would be of size A4. Thank you

https://developers.arcgis.com/en/javascript/jssamples/widget_print_esri_request.html
0 Kudos
4 Replies
JonathanUihlein
Esri Regular Contributor
Absolutely.

From the sample you posted, you can change the names by changing attributes for:

layoutTemplate[0].choiceList

or
templateNames


For example:

layoutTemplate[0].choiceList[0] = "Landscape";

OR
templateNames[0] = "Landscape";


Hope this helps.
0 Kudos
ionarawilson1
Occasional Contributor III
Thank you Jonathan! It worked!!! I also changed the code to remove the other options

    layoutTemplate[0].choiceList.splice(2, 7)

Thank  you!!!
0 Kudos
JonathanUihlein
Esri Regular Contributor
Awesome!! I'm glad it works.

Let me know if any issues arise 😃
0 Kudos
ionarawilson1
Occasional Contributor III
Actually the changes are made visually, but I click to Print, the printing does not work. It shows "Printing" for a millisecond then goes back to "Print" and it never shows a "Printout". I am going to try on the sandbox to see what happens
0 Kudos